Hello, I want to know if it's possible to upload a file to www.rapidshare.com using a PHP script that resides on my site and then retrieve the URL of the uploaded file? Rapidshare offers a script to do this, but it's written in Perl and I do not know this language at all. Does someone know how to make this work in PHP, or somehow integrate that Perl Script into PHP so it can upload/retrieve uploaded URL? I have attached the Perl Script offered by Rapidshare.
Use CURL to POST the file to rapidshare, then scrape the returned page for the information you need. Your php script might time out though, while the file is uploading.
Why do you say it will timeout? Isn't the same as if someone would upload a file on my site using PHP?
<form name="ul" method="post" action="http://rs97l3.rapidshare.com/cgi-bin/upload.cgi?rsuploadid=99619963777997544" enctype="multipart/form-data" onsubmit="document.ul.u.value='Please wait ...';document.ul.u.disabled=true"> <a href="#" onclick="switchfiles()">Multi-Upload</a> Choose your upload-datapath: Cogent <input name="mirror" type="radio" onclick="document.ul.action='http://rs97cg.rapidshare.com/cgi-bin/upload.cgi?rsuploadid=99619963777997544';document.ul.u.value='Upload via Cogent'"> Level(3) <input checked name="mirror" type="radio" onclick="document.ul.action='http://rs97l3.rapidshare.com/cgi-bin/upload.cgi?rsuploadid=99619963777997544';document.ul.u.value='Upload via Level(3)'"> Telia <input name="mirror" type="radio" onclick="document.ul.action='http://rs97tl.rapidshare.com/cgi-bin/upload.cgi?rsuploadid=99619963777997544';document.ul.u.value='Upload via Telia'"><br> <div id="files"><input type="file" size="64" name="filecontent"> <input type="submit" name="u" value="Upload!"></div></form>
But the problem is This value rsuploadid=99619963777997544 keeps on changing, So this method cannot be used.
Well, You would have to first fetch the Upload page ( In this case http://rapidshare.com/ )using Curl. Parse the page using regular expressions to find that unique submit url using the preg_match PHP: function. Then POST the file to that page. ~ Thomas
That was great man , but please can anyone help me to do the same thing but now with those hosting sites : 1) FileDude.com 2) FileApe.com 3) zShare.net 4) Mediafire.com 5) 2shared.com 6) Rocketfile.net