I have experienced experience in developing websites in my business, I have always feel very headache. I used to upload images in the earliest, but every time I upload, the client wants to download the plugin. To the later no component upload, although there is no client, the management is a bit zero chaotic on the website: 1. Put the picture directory to be able to handle, delete permissions. 2, can not be renamed, so to solve the method of the picture name. 3. For example, the picture is uploaded for the issuer news. When you want to delete the news, you should write a code to delete the image. Because the relationship between permissions is likely to delete or delete the speed of the page. 4, it will also be easily subject to other websites, stealing chains. So, I think it is good to set the picture uploaded by each module and centralized management is good! Specific operation: Create a new table, used to store the second data of the picture, an automatic plus one ID number. When the image is uploaded, the binary data of the picture is stored in the library, then get the ID number of the image, and the record is recorded as soon as the ID number is recorded! The warehouse program (as an example): Demo1.asp <% 'Picbriny is the picture binary data. As for how to get pictures binary data from the form, you can find a component-free uploading principle 'table name PIC' column name image to store the two-binary data of the picture 'column ID automatically add a RS.Open "PIC", conn, 1 3 rs.addnew () rs.fields ("image"). Appendchunk picbriny rs.Update 'You can get the ID number of the picture: rs.fields ("ID") rs.close%> Image displayed page: Demo2.html
head> Image