The previous attachments and documents have some shortcomings, such as file reintegration, URL encoding problems, security issues brought by exposed files, especially since the SP check, you need to download files, security issues, and URL encoding problems with Internet. solve
Method for downloading attachments and files after unify:
From the perspective of the application, the database table uses a three-level structure to save attachments and file information. The first stage is the Application_List table, contains at least one unique number field, such as the draft ID, the notification ID, the second level is an attachment table, record the attachment It belongs to the applicationList, and the file number corresponding to the attachment, the third level is a real file list, which contains a unique number of GUID ID, and the display name of the file and the actual storage path on the server (both The file name can be the same, or different), the schematic is as follows:
When an attachment is uploaded, if there is already a common file, keep the display name of the file unchanged, and modify its actual storage file name (just like Microsoft's Exchange, add a non-repetitive number after the file name)
The download of the file is done by a download.asp. When calling download.asp, the file ID is incorporated as the parameter, which acquires the display name of the file from the database and the actual storage path and outputs it to the client, such as:
Http: //txd/download.asp? fileid = a17ecdea-756e-4203-93e6-fe50D887E96F
The list of files is a relatively independent table. An attachment for any application can be stored in this table, and the application is attached to its attachment list.
The above is a handling method for attachment documents, for mobile, other types of files: FTP passing through various files and provincial report files reported by the provincial company, only need to process these files in DTS to insert the file LIST table into the corresponding record