Jump to content

Limiting an upload size


unknown101

Recommended Posts

 

Hi Guys,

 

Im working on an upload system whereby a user can upload an audio track, but there needs to be a size limit so it uploads no more than 30 seconds.  For example they can select a whole track from their hard disk but this will be cut and transferred to the server.

 

Obviously we have the MAX_FILE_SIZE function, but does this assess the size of the file then upload if its under the specified amount or does it just start the upload and completely fail if its out of the specified limit (also if this did happen would it leave part of the file on the server?).

 

So basically im looking for the most effecient way of cutting the first part of a audio file (.mp3) and uploading.

 

Any help or suggestions are appreciated!

 

Thanks in advance

Link to comment
Share on other sites

You can't take a sample from the track client side - you will have to let them upload the entire track and then use mencoder to extract a sample - just google mencoder or mplayer - I know it says movie stuff but it does handle audio too!!!

 

You will need to be able to use exec in your scripts and be able to install mencoder on your server..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.