Forum Discussion
fpieressa
Altostratus
Dec 27, 2009Allow or Deny http upload file by extension
Hi! Is there any way to force in a Web Application that only some specific file extentions can be uploaded using Form-based File Upload (RFC 1867)? Using this way, the file is not uploaded in an http parameter, they are uploaded in the body of the http POST using MIME... thanks!
- hoolio
Cirrostratus
ASM should still parse the parameters and values in a multipart/form-data based upload request. - hoolio
Cirrostratus
Can you post an anonymized copy of the request? - fpieressa
Altostratus
Of course, here you have, thanks! - hoolio
Cirrostratus
In just about every multipart form upload request I've seen (and your example) the file name the client provides is included in the filename parameter. The RFC states it could be specified in an actual HTTP header, but I've never seen that done. In your example, the actual data is passed in the uploadedfile parameter. So you could configure an object of "/upload.php" and possibly two object parameters. filename would be the one you'd restrict the file name extensions with a regex for. If you want to allow binary content to be uploaded, you'd want to define a second parameter named uploadedfile with a type of binary (length check only). - fpieressa
Altostratus
Great! Applying a regex to the "filename" parameter works perfectly, I didn't understand how multipart works, thanks! - hoolio
Cirrostratus
Good to see you got it working.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects