Forum Moderators: coopster

Message Too Old, No Replies

File upload

         

abhilash0000

10:17 am on Jan 22, 2008 (gmt 0)

10+ Year Member



hi can some body help me with this upload concept to upload files to rapidshare from my site i already have the regualr upload to my server through my site which is working (how do we do tat to sites like rapidshare megaupload from my site)

phparion

11:38 am on Jan 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



study file uploading with cURL [php.net]

You will need to track rapidshare and other free file hosting site's headers; for which you can use different softwares e.g LiveHTTPheader for Firefox.

Then you will use php-cURL to create artificial process similar to third party site and send your files.

abhilash0000

1:49 pm on Jan 22, 2008 (gmt 0)

10+ Year Member



there are many sites that do this, how do they distribute files to many servers at a single click

[edited by: jatar_k at 2:59 pm (utc) on Jan. 22, 2008]
[edit reason] no urls thanks [/edit]

abhilash0000

4:27 pm on Jan 22, 2008 (gmt 0)

10+ Year Member



can any one help?

coopster

6:36 pm on Jan 22, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, abhilash0000.

how do they distribute files to many servers at a single click

You can distribute files to many servers in a single click by using processes on the server side. cURL is one tool that was mentioned. Basically you are going to accept a file upload and then distribute it via socket connections on your server that accepted the file upload.

abhilash0000

7:36 pm on Jan 22, 2008 (gmt 0)

10+ Year Member



hi thanks a lot buddy culd u please give me a sample code so tat i can understand much better or any reference links wuld aldo do the job

abhilash0000

7:37 am on Jan 23, 2008 (gmt 0)

10+ Year Member



any sample script or examples please

coopster

9:34 am on Jan 23, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



There is an old thread in the PHP Forum Library [webmasterworld.com] that describes a Single form posted to multiple locations [webmasterworld.com] that may get you started.

abhilash0000

12:20 pm on Jan 24, 2008 (gmt 0)

10+ Year Member



thanks a lot buddy i got it so this form to multiple locations is very similar to wat i asked for? u use sockets in this ....thanks for u r help ..if u can give any further assistance i wuld be even more thankful

phparion

1:43 pm on Jan 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



dear friend, you already got lots of ideas from here to work on... you cannot expect to get a working example of this.. you need to do it...

did you study cURL manual? you will find lots of information to proceed from there. Google PHP CURL LIBRARY; follow the second link on the results; you will definitely find file uploading with cURL examples on this site, I had posted one myself a while ago but dont have its exact url so search it... also try joining their mailing list and ask wherever you are stuck..

McBlack

10:24 pm on Jan 24, 2008 (gmt 0)

10+ Year Member



Can't you use a post code? For the HTML, do this:

index.html


<form action="upload.php" method="post">
<h1>Upload</h1><br>
<table border="0"><tr><td>
<tr><td>File:&nbsp;<input type="file" name="upload"></td></tr></td></tr><tr><td><tr><td><input type="submit" value="Upload"></td></tr></table>

I don't have the time to make the php, but here's one from w3schools.
upload.php


<?php
if (($_FILES["file"]["type"] == "image/gif")
¦¦ ($_FILES["file"]["type"] == "image/jpeg")
¦¦ ($_FILES["file"]["type"] == "image/pjpeg")
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file";
}
?>

abhilash0000

7:35 am on Jan 25, 2008 (gmt 0)

10+ Year Member



hey yaa thanks a lot ya im still working on it i just got stuck at conecting to multiple servers and im working on curl .thanks for the help buddy.i have posted one more topic y dont u just guide me through tat too