Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload File: Maximum Size

Status
Not open for further replies.

aarushi2001

Technical User
Nov 16, 2005
109
0
0
US
Hi,

I have successfully managed to create a form which allows users to upload file and is storing to destination required. I need one last help regarding this matter:

1. How can set maximum file size and prompt an erro if user tries to upload a file more then size specified.

2. How can I accept only PPT file type, and again catch exception if some other file type is being uploaded.

Thanks
 
Use the server code that saves the file :

- There should be a Content-Length header to determine the file size. If it is greater than n, then throw an exception or a message back to the client.

- As for file type, check the Content-Type header, and the file extension name.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top