Correct upload file Skills _ website Application

Source: Internet
Author: User
Tags file upload
The user's point of view, uploading the right documents should be self-discipline-oriented. Upload files should adhere to the two principles, the first is to make sure that the file will be used to upload, and secondly is to try to small. Here, let me illustrate.

For example, users upload images, JPG, GIF and PNG image format can show the effect and content is different, but do not recommend the above format as a picture format for uploading files. Here, there is a connection that explains these things in detail.

Personal Blog Photos If you need illustrations, you can consider using such as Yupoo, such as picture sharing site, of course, the premise is that content to meet their requirements. This allows you to reduce some storage space per month and be more manageable. The volume of the illustration should be controlled within 500KB, and the size should be controlled at 800px (on the widest side). According to my experience, this is best for reading.

The same truth, if it is your own server, if not necessary, try not to upload video and other files, because these files will quickly consume your space. You can put some public videos on Youtube and other websites, which can also play a role in streaming.

Never doubt the power of spiders, files once uploaded to the server, even without any connection, are likely to be accessed (stupid server). So don't upload your personal data to the server. Otherwise, it can cause unnecessary trouble in addition to wasting server space.

The uploaded file should try to avoid characters such as spaces, Chinese, full-width punctuation, and so on, because the server may not be able to handle these files correctly (albeit a bit of a fuss). The best way to do this is to recommend a file name that is easy to understand in combination with English, numbers, and underscores.

Then, here are some development experiences as a developer.

Never doubt the ability of a script to be corrupted, and a small script might destroy the entire server. So avoid PHP, ASP, JSP, such as these server script upload, Windows host special attention to avoid users upload executable files. The *ix server should immediately mark the permission as 644 (directory permissions are 755) after the upload operation. This is the first one, and it is the most general one.

If the user is not very concerned, we should help them rebuild the file name of the uploaded file. The file name should contain regular names such as file upload dates, so that it is easy to differentiate and be easily backed up by features. Renamed files are recommended in lowercase (this is my personal habit).

Finally, it is recommended that the mechanism of uploading verification should be relaxed appropriately. Please don't misunderstand the meaning of my last remark. For example, what I said above the upload of the picture format, in the "Escape" the client's checksum, found that the user or upload a BMP picture, this time should be within the appropriate allowable range, you can consider converting it to a specified appropriate format storage, rather than "pedantic" to the error.

This is it, there should be some other more useful experience, in order to avoid sweeping, welcome to discuss together.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.