For a long time the document did not understand how to limit the upload size and upload format, please master can answer thank you.
It would be better if we could have a presentation.
I'm using a form to upload PHP SDK
Reply content:
For a long time the document did not understand how to limit the upload size and upload format, please master can answer thank you.
It would be better if we could have a presentation.
I'm using a form to upload PHP SDK
Limit size can be set in policy fsizelimit
Fsizelimit limit the size of the uploaded file, in bytes (byte) exceeding the limit of upload content will be sentenced to upload failed, return 413 status code.
The limit suffix can be set in policy detectmime,mimelimit
Detectmime turn on the mimetype detection function
Set to a value other than 0, ignores the file mimetype information that is passed on the upload side, and uses the seven KN server to detect the content.
The default value is set to 0, which is used directly if MimeType is specified on the upload side, otherwise the MimeType value is detected in the following order:
1. Check the file name extension
2. Check the key extension
3. Detect content.
Mimelimit limit the types of files that users upload
Specify the value of this field, seven cattle server will detect the contents of the file to determine the mimetype, and then use the judgment value to match the specified value, matching success allows uploading, matching failed to return 403 status code
Example
1. "Image/*" indicates that only the image type is allowed;
2. "Image/jpeg;image/png" means that only images of JPG and PNG types are allowed to be uploaded;
3. "!application/json;text/plain" means to disallow uploading of JSON text and plain text (note the first exclamation point).