The current form upload supports defining a key, for example, defined as upload/2014607/983d.jpg, but does not actually work and needs to be optimized. The reason is that the server does not know what type of file the client is uploading, such as *.jpg, and the file that the client uploads may be PNG or doc, so this method of specifying key has no effect on the form upload unless the system only allows the client to upload only the specified file type.
When a form is recommended for uploading, the defined key is simply the file name, excluding the extension, and the extension is automatically added by the system to the original file.
Hope to solve this problem immediately, very need!
Reply content:
The current form upload supports defining a key, for example, defined as upload/2014607/983d.jpg, but does not actually work and needs to be optimized. The reason is that the server does not know what type of file the client is uploading, such as *.jpg, and the file that the client uploads may be PNG or doc, so this method of specifying key has no effect on the form upload unless the system only allows the client to upload only the specified file type.
When a form is recommended for uploading, the defined key is simply the file name, excluding the extension, and the extension is automatically added by the system to the original file.
Hope to solve this problem immediately, very need!
Don't understand the landlord's meaning, you can specify the mimetype of the file when the form is uploaded. PHP SDK in: https://github.com/qiniu/php-sdk/blob/develop/qiniu/io.php
Then combine the upload strategy:
Http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html
The fields in the detectMime
MimeType control.