By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

Upload *huge* files, is it wise with PHP ?

P: n/a
Hello,

I need to allow an end user to upload video files on a server and in the
same time to put the file name and a few infos in a database. It must be
very simple for the end user, and uploading with a browser in a form
would be perfect since it allows to upload and fill a form in the same
time.

I'll have full control of the server (no max_size problem etc). The end
user connexion is ADSL, the server is on a 100mb internet connexion.

But I'm worried because the file upload by PHP (at least what I code
usually) will probably timeout (the files will be 200mo at least) or
have problems, and you can't resumean aborted transfert. FTP would be
better but it is not as simple for the end user, especially because he
has to give some more informations (style of the video, how long it has
to stay on the server etc) wich will be stored in the database..

What would you use to keep the operations easy, reliable and OS
independant ? Thanks for any suggestion

Stephane
PS: sorry for my weak english

--
Stephane
Please replace "INVALID" by "free" to send me an email.
Merci de remplacer "INVALID" par "free" pour m'envoyer un email.
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 2003-12-12, Stephane <St******@INVALID.fr> wrote:
Hello,

I need to allow an end user to upload video files on a server and in the
same time to put the file name and a few infos in a database. It must be
very simple for the end user, and uploading with a browser in a form
would be perfect since it allows to upload and fill a form in the same
time.

I'll have full control of the server (no max_size problem etc). The end
user connexion is ADSL, the server is on a 100mb internet connexion.

But I'm worried because the file upload by PHP (at least what I code
usually) will probably timeout (the files will be 200mo at least) or
have problems, and you can't resumean aborted transfert. FTP would be
better but it is not as simple for the end user, especially because he
has to give some more informations (style of the video, how long it has
to stay on the server etc) wich will be stored in the database..

What would you use to keep the operations easy, reliable and OS
independant ? Thanks for any suggestion


ILHO is ftp the only way to go.
What you could do is let them just submit the text fields, once they
have done this, you provide them a "config file" that contains the
settings where things need to be uploaded...

Now the client only has to call a command like ftp < settings.txt
With a little program that has dnd support, the client would only have
to dnd the file over that program to start the upload....

--
verum ipsum factum
Jul 17 '05 #2

P: n/a
Regarding this well-known quote, often attributed to Tim Van Wassenhove's
famous "12 Dec 2003 09:45:01 GMT" speech:
On 2003-12-12, Stephane <St******@INVALID.fr> wrote:
Hello,

I need to allow an end user to upload video files on a server and in the
same time to put the file name and a few infos in a database. It must be
very simple for the end user, and uploading with a browser in a form
would be perfect since it allows to upload and fill a form in the same
time.

I'll have full control of the server (no max_size problem etc). The end
user connexion is ADSL, the server is on a 100mb internet connexion.

But I'm worried because the file upload by PHP (at least what I code
usually) will probably timeout (the files will be 200mo at least) or
have problems, and you can't resumean aborted transfert. FTP would be
better but it is not as simple for the end user, especially because he
has to give some more informations (style of the video, how long it has
to stay on the server etc) wich will be stored in the database..

What would you use to keep the operations easy, reliable and OS
independant ? Thanks for any suggestion


ILHO is ftp the only way to go.
What you could do is let them just submit the text fields, once they
have done this, you provide them a "config file" that contains the
settings where things need to be uploaded...

Now the client only has to call a command like ftp < settings.txt
With a little program that has dnd support, the client would only have
to dnd the file over that program to start the upload....


On that note, if you could put each user's files into a seperate directory
from the FTP, you could make it an only marginally more difficult process:

1.) They upload the file via FTP.
2.) When the upload completes, they go to the website and log in.
3.) They get a list of their "uploads" directory, and can pick one or more
files.
4.) After selecting the correct files, they go to a screen where they can
add the proper "tagging" information.
5.) The PHP script then...
o Moves the files to their proper place on the website (if needed)
o Associates the information with the file(s)
Hairballs you might have to watch out for are:
o Making sure the file is comepletely uploaded before moving it.
o If the file gets moved to a public area, watch for filename collisions.
Rename the files if needed, and make sure the tagging reflects the rename.
o Make sure no one can hijack the system and use it to "implant" files in
unauthorized areas.
Barring that, I think PERL, with its more "streaming" (versus PHPs "get the
upload, then process the output") treatment of POST data, has a few good
upload progress-bar scripts. It might be something to check out.

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #3

P: n/a
"Stephane" <St******@INVALID.fr> wrote in message
news:sl*********************@ernest.cheska.net...
Hello,

I need to allow an end user to upload video files on a server and in the
same time to put the file name and a few infos in a database. It must be
very simple for the end user, and uploading with a browser in a form
would be perfect since it allows to upload and fill a form in the same
time.

I'll have full control of the server (no max_size problem etc). The end
user connexion is ADSL, the server is on a 100mb internet connexion.

But I'm worried because the file upload by PHP (at least what I code
usually) will probably timeout (the files will be 200mo at least) or
have problems, and you can't resumean aborted transfert. FTP would be
better but it is not as simple for the end user, especially because he
has to give some more informations (style of the video, how long it has
to stay on the server etc) wich will be stored in the database..

What would you use to keep the operations easy, reliable and OS
independant ? Thanks for any suggestion

Stephane
PS: sorry for my weak english

--
Stephane
Please replace "INVALID" by "free" to send me an email.
Merci de remplacer "INVALID" par "free" pour m'envoyer un email.


Have you tried:

set_time_limit(0);

as the first line of your code?

sets unlimited time - or enter the time in seconds.

Jul 17 '05 #4

P: n/a
Regarding this well-known quote, often attributed to SwissCheese's famous
"Wed, 17 Dec 2003 11:00:48 GMT" speech:
"Stephane" <St******@INVALID.fr> wrote in message
news:sl*********************@ernest.cheska.net...
Hello,

I need to allow an end user to upload video files on a server and in the
same time to put the file name and a few infos in a database. It must be
very simple for the end user, and uploading with a browser in a form
would be perfect since it allows to upload and fill a form in the same
time.

I'll have full control of the server (no max_size problem etc). The end
user connexion is ADSL, the server is on a 100mb internet connexion.

But I'm worried because the file upload by PHP (at least what I code
usually) will probably timeout (the files will be 200mo at least) or
have problems, and you can't resumean aborted transfert. FTP would be
better but it is not as simple for the end user, especially because he
has to give some more informations (style of the video, how long it has
to stay on the server etc) wich will be stored in the database..

What would you use to keep the operations easy, reliable and OS
independant ? Thanks for any suggestion

Stephane
PS: sorry for my weak english

--
Stephane
Please replace "INVALID" by "free" to send me an email.
Merci de remplacer "INVALID" par "free" pour m'envoyer un email.


Have you tried:

set_time_limit(0);

as the first line of your code?

sets unlimited time - or enter the time in seconds.


Would that be "wise", though... if you made some accidental loop in your
code, that unlimited limit could pose quite a problem, non?

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #5

P: n/a
"FLEB" <so*********@mmers.and.evil.ones.will.bow-down-to.us> wrote in
message news:96*****************************@40tude.net...
Regarding this well-known quote, often attributed to SwissCheese's famous
"Wed, 17 Dec 2003 11:00:48 GMT" speech:
"Stephane" <St******@INVALID.fr> wrote in message
news:sl*********************@ernest.cheska.net...
Hello,

I need to allow an end user to upload video files on a server and in the same time to put the file name and a few infos in a database. It must be very simple for the end user, and uploading with a browser in a form
would be perfect since it allows to upload and fill a form in the same
time.

I'll have full control of the server (no max_size problem etc). The end
user connexion is ADSL, the server is on a 100mb internet connexion.

But I'm worried because the file upload by PHP (at least what I code
usually) will probably timeout (the files will be 200mo at least) or
have problems, and you can't resumean aborted transfert. FTP would be
better but it is not as simple for the end user, especially because he
has to give some more informations (style of the video, how long it has
to stay on the server etc) wich will be stored in the database..

What would you use to keep the operations easy, reliable and OS
independant ? Thanks for any suggestion

Stephane
PS: sorry for my weak english

--
Stephane
Please replace "INVALID" by "free" to send me an email.
Merci de remplacer "INVALID" par "free" pour m'envoyer un email.


Have you tried:

set_time_limit(0);

as the first line of your code?

sets unlimited time - or enter the time in seconds.


Would that be "wise", though... if you made some accidental loop in your
code, that unlimited limit could pose quite a problem, non?

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com


Well, that part of the equation is left up to the programmer of the
script. Take alook at this link:
http://us2.php.net/manual/en/feature...n-handling.php

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.