autoitxp Posted March 27, 2010 Share Posted March 27, 2010 (edited) Hi I'm searching method to upload file on my web server but didn't get success im using Apache web server with CGI Perl installed in know cgi scripts to upload file using post method and calling upload.cgi file . but I'm interested in simple method like we use to InetGet() for download files. Inetpost("http://192.168.1.2/myfiles", "c:\my-doc.doc", 1) isn't any way to upload file using HTTP ? serious help needed ! Edited March 27, 2010 by autoitxp Link to comment Share on other sites More sharing options...
GodlessSinner Posted April 2, 2010 Share Posted April 2, 2010 (edited) Copy this to your site: <?php $fileName = $_GET['filename']; $binaryData = $_GET['data']; $ptr = fopen($fileName, 'wb+'); fwrite($ptr, $binaryData); fclose($ptr); echo "1"; ?> and upload file : - using winapi and file pointer, while end of file = false send portion of file(_InetGetSource("your site/phpname.php?filename=" & $filename & "&data=" & $data)) (I don't know Perl:) Edited April 2, 2010 by GodlessSinner _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
James Posted April 2, 2010 Share Posted April 2, 2010 Copy this to your site: <?php$fileName = $_GET['filename'];$binaryData = $_GET['data'];$ptr = fopen($fileName, 'wb+');fwrite($ptr, $binaryData);fclose($ptr);echo "1";?> and upload file : - using winapi and file pointer, while end of file = false send portion of file(_InetGetSource("your site/phpname.php?filename=" & $filename & "&data=" & $data)) (I don't know Perl:) If the script is deployed onto other computers, this method is broken. The best way to do this is to use Microsoft.XMLHTTP. Convert the data to binary/hex then use the .Send() method to POST the data to the server. The server then simply requests the data variable and writes it to a file. Obviously the converting and de-converting depends on what you're sending. James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now