Erdenemandal Posted September 1, 2004 Posted September 1, 2004 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 Quote
*Experts* Bucky Posted September 6, 2004 *Experts* Posted September 6, 2004 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. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Erdenemandal Posted September 6, 2004 Author Posted September 6, 2004 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 Quote
Erdenemandal Posted September 8, 2004 Author Posted September 8, 2004 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 Quote
*Experts* Bucky Posted September 8, 2004 *Experts* Posted September 8, 2004 Congrats! :) Thanks for sharing your code. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.