weblcient.uploadfile

Erdenemandal

Regular
Joined
Jul 5, 2004
Messages
63
Location
Deutschland
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
 
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.
 
Bucky said:
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
 
Upload PHP code

HI, I have done.

this is a code (php Code) :p

Code:
$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

Code:
 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
 
Back
Top