开发者

File upload, renamed automatically

开发者 https://www.devze.com 2023-04-04 02:39 出处:网络
When I do a file upload using FileStore, it automatically renames the uploaded file. Is it possible to not do this? Because when I do a开发者_Go百科 download, the real file name doesn\'t have an exte

When I do a file upload using FileStore, it automatically renames the uploaded file.

Is it possible to not do this? Because when I do a开发者_Go百科 download, the real file name doesn't have an extension, and the client doesn't know how to open it.


The solution is to setup mod-rewrite like this:

RewriteRule /upload/(.*).jpeg  $1  [L]

This way you can use extension "jpeg", and it would still point to the right file.

Leaving default filenames is insecure.

0

精彩评论

暂无评论...
验证码 换一张
取 消