Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Advise required re: uploading files to server

  • 10-05-2006 08:22PM
    #1
    Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭


    hello,
    I will soon be writting a php script which allows a user to upload mp3s to a server. The user needs to enter their 'name' , 'email', 'track name', and 'description' into a form , as well as selecting the file for upload before uploading. The form information is stored within a mysql database and the file is upload to a dir on the server. All the fields are required, and the only file that can be uploaded is of .mp3 extension. I expect the average file size to be in the 80mb region. As a result i have some issues.

    Lets say it takes about 20 minutes to upload a mp3, i will need some visual repesentation to show a progress bar, so ajax is a obvious contender. Does anyone know of another way to do this without using ajax?

    Would it be best to have the form require the 4 fields (name, email, track name and description) on page 1, validate those fields, and then ask for the upload on page 2 due to the time it would take to upload the mp3? I have written a test php file for this and i have all the forms on the one page at the moment.

    I will more than likely dynamically generate the page urls to avoid people skiping to page 2 and the like. To avoid someone uploading the same track twice or person x having the same track title as person y on the server i think i will alter the filename on upload. I will add a hash value to the mp3 title. I can probably validate this too fairly easily too actually.

    What other secuirty, validation issues would i need to consider? Is a 80mb file too large to upload in this manner? What would you do? Suggestions please.

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    An old work colleague that i used to work with said that PHP can't support something like that? He used a Perl script instead working with the PHP script to show the status of an upload.


  • Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭Rollo Tamasi


    php on its own can't but combained with ajax it can. i doubt i could use a flash file to indicate the upload progress either so ajax is probably the only option unless i use a perl script to conduct the upload but i'm not familar with perl.


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Yeah well sorry couldn't be more of a help. Perl though is not that hard to learn its very similer to php by syntax actually.

    Check out http://sourceforge.net/projects/megaupload/


  • Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭Rollo Tamasi


    i have seen that before, its nice. I might examine it further when i get closer to the date when i require the upload script


  • Closed Accounts Posts: 382 ✭✭misterq


    It is perl based but I found it very good with large files and pretty easy to embed it into a php form via iframe to combine it with a database insert:
    http://encodable.com/tech/ajaxupload/

    R


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭Rollo Tamasi


    cheers.


Advertisement