Measurement rapid Development platform, fields can be set to attachment type, set to field of attachment type, after uploading the data, the data format saved in the field is as follows:
32-bit accessory code|Annex 1 Name
32-bit accessory code|Annex 1 Name\Annex 2 Name
32-bit accessory code|Annex 1 Name\Annex 2 Name\Annex 3 Name
You can upload multiple attachments after you see an attachment field setting in the format above. According to the storage data format, we recommend that the attachment of this field length as long as possible, such as the length of 1000 or 2000, so upload a few attachments will not prompt the word descriptor long.
Metric Rapid development platform, the Attachment field is encrypted to the server side, in fact, the database only records the location of the encrypted files on the server. Therefore, we have to build our own features to implement the view and download of attachments, we need a special method to implement. This approach has also been provided in the metric rapid development platform.
The following example shows the case of reading an attachment to a piece of data in the business:
Dimsql= ""
sql="Select File_name,floder,file_save_name from Sa_attachfiles where attachcode= '32-bit accessory code' "
Dimdt =ExecuteSelect(SQL)
Grid Part 1. Datatable=dt
Grid Part 1. Refreshdatabydatatable ()
in the above grid part, the attachment data for the business data is listed, and there may be multiple attachment data.
write on the double-click event of the mesh part:
DownloadFile(grid Part 1.) Getfocusedrowvalue ("file_name"), mesh Part 1. Getfocusedrowvalue ("File_save_name"), 1, grid Part 1. Getfocusedrowvalue ("Floder"))
you can download and open the attachment.
DownLoadFilefunction:
' first parameter: a local file name. such as: file. doc, which is the file name saved to the local.
' second parameter: file name on the server
' third parameter: The file directory on the server, the default value is 1
' fourth parameter: A subdirectory name on the server, no null value
DownloadFile ("Test. xls", "23b4709f0b034ef7a55f4c21ad365481.at", 1, "File directory")
Original address: http://bbs.delit.cn/thread-950-1-1.html
Reprint please specify the source:
Author: metric Technology www.delit.cn
Introduction to the attachment fields in the Metric rapid development Platform