Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi, ALL

 

I want to upload file to the Server. in my Server running Apache and PHP. When I saw examples, they always explain with aspx. But I want to use PHP with uploadfile method.

 

Can somebody help me.

 

Thanks,

Erdenemandal

  • *Experts*
Posted

The WebClient.UploadFile() method uploads the file through the POST headers of the

request for the page. I don't know any PHP, but I know there is an easy way to

access these headers on your PHP page. Find the POST header and find a way to save

this byte array to your server.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted
The WebClient.UploadFile() method uploads the file through the POST headers of the

request for the page. I don't know any PHP, but I know there is an easy way to

access these headers on your PHP page. Find the POST header and find a way to save

this byte array to your server.

 

 

good Idea. That I can correct Variable from POST array.

 

Thanks,

Erdenemandal

Posted

Upload PHP code

 

HI, I have done.

 

this is a code (php Code) :p

 

$userfile_name = $HTTP_POST_FILES["file"]["name"] ;
$userfile = $HTTP_POST_FILES["file"]["tmp_name"] ;
$PID = $HTTP_GET_VARS["PID"] ;

copy($userfile,$uploaddir."LogFile_PID".$PID.".log") ;

 

and VisualBasic code :D

 

If myConnection.IsConnectedLife Then
         If System.IO.File.Exists(CurDir() + "\sources\Logs\Running.log") And mPersonID Then
                 myUri = "http://myWebHost/upload.php?PID=" & mPersonID
                 wclient.UploadFile(myUri, "POST", CurDir() + "\sources\Logs\Running.log")
                StatusBar1.Panels(0).Text = "Log file is transferred"
         Else
          StatusBar1.Panels(0).Text = "Error"
        End If
End If

  • *Experts*
Posted
Congrats! :) Thanks for sharing your code.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...