Myspace Layouts - Magazine Subscriptions - Personal Loans - Debt Help - Co op Advertising

PDA

View Full Version : How Can I Upload to Rapidshare.com using PHP Script


msmp3
Jul 30th 2007, 6:11 am
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.

matthewrobertbell
Jul 30th 2007, 7:18 am
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.

msmp3
Jul 30th 2007, 7:23 am
Why do you say it will timeout? Isn't the same as if someone would upload a file on my site using PHP?

matthewrobertbell
Jul 30th 2007, 8:21 am
Ah yea, maybe.
If it does timeout, you could always use set_time_limit().

madmax728
Jul 30th 2007, 9:22 am
<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: &nbsp;&nbsp;&nbsp; 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>

madmax728
Jul 30th 2007, 9:23 am
But the problem is
This value rsuploadid=99619963777997544
keeps on changing,
So this method cannot be used.

Vbot
Jul 30th 2007, 4:48 pm
Why not login to your rapidshare account then use remote upload instead.

msmp3
Aug 12th 2007, 10:27 am
Why not login to your rapidshare account then use remote upload instead.

I would like to do this automatically... this is why Remote Upload option is not suitable....

coderlinks
Aug 12th 2007, 11:00 am
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 function. Then POST the file to that page.

~
Thomas

msmp3
Sep 22nd 2007, 3:44 am
I'm going to try something like @coderlinks said... see if it works :)