When you specify a file item, an input field as shown in Fig. 1 is prepared.
- You can register files by dragging and dropping files to "Select files" button.
On the detail display screen, the image is displayed as shown in Fig. 3.
You can also register non-image files such as Word and Excel.Icons are displayed as shown in Fig. 4 on the detailed display screen.
Select "File type" in the type detail setting of the string type item.
When an item of "file name" type is set as a search condition, the file name is searched.Since it is treated as a string type, you can also specify a search method such as partial match, forward match.
You can also search the contents of files such as Word, Excel, PowerPoint, and PDF. Please read "Full Text Search" for details.
For file items in the repeating container, you can register multiple files by dragging and dropping them all at once.The button name is "Select multiple files".
I dragged and dropped two files.
When you press the save button, "2 records" is registered in the repeating container part.In other words, it is registered as one record for each file.
The Wagby file type has the following behavior.
Behavior varies depending on the browser.
|browser||Multiple file upload||Drag and drop operation||Bag ground upload|
|IE 9 or earlier
The file body is not stored in the database.A folder of model ID is prepared in the folder called upload_dir, and temporary file name is added to it and it is saved.
When you create a file type item, there are two items in the corresponding (database) table.Here is an example.
Suppose you prepare a file type field photo for model product.At this time, the table product is created, but two items are prepared as follows.
|item name||Description||An example|
|photo||The file name is stored.||duke3D.jpg|
|photo_jshfilename||Indicates the path where the file exists.The starting point is wagbyapp/bin.||../../upload_dir/product/__multi1869501174086226700.tmp|
The entity of the uploaded file is stored in the upload_dir folder.The file name is internally changed mechanically, and the extension is ".tmp".(FIG. 10)
You can select this rule from the following three types by specifying "real file name saved in server" in "screen> others> file name type item".
Figure 11 shows the upload_dir folder when "Use original file name as is" is set.It is stored as the file name at upload.
If you change the settings so as to change the settings so that "use the original file name as the file name as it is" after operation, and rebuild the application, replacing the application will be as follows.
We provide a tool for restoring the name of the .tmp file registered in the past to the original file name. For details, please read "Change file name handling to method to leave original file name".
In Wagby, when you define an item of file type, two columns are prepared in the table.
When file deletion processing is carried out, the file name information is deleted from the database, but the entity of the file remains.If you set the file name to use the original file name as it is, it will be overwritten by uploading the file with the same name.
The reason for leaving the entity of the file in the upload_dir folder is as follows.
There is a job to periodically delete the (remaining) entity of the file. "Support> Administrator Guide (R7)> Delete unreferenced file deletion job" Please read.
There is also a method of deleting the entity of the file at the timing of data deletion.Please do this only if it does not correspond to "the reason to leave the entity of the file in the upload_dir folder".
Include the following contents in the context-param specification in the $ (APPHOME) \ webapps \ $ (APPNAME) \ webpage \ WEB-INF \ web.xml file that is the post-build application.
<context-param> <param-name>file_delete_mode</param-name> <param-value>UnsavedFile</param-value> </context-param>
After adding the above setting, restart the application.This setting applies to the entire application.
It does not correspond to list update, upload update, bulk update, mail reception, file deletion in mail transmission.Also, when using Dao/Service with customization code, it is not supported yet.These are plans to cope with future Wagby.
You can specify the width and height of the image on the detailed display screen and the list display screen respectively.(FIGS. 12 and 13)
Select the output control tab of model item detail definition.Specify "image size" on the detail screen and the tab of the list screen.The unit is pixel.Both width and height can be specified, but when one is specified, the other is automatically adjusted while maintaining the ratio.
You can hide the file name.(Figure 16)
Select the output control tab of model item detail definition.Uncheck "Show file name (URL)" on tabs of detailed screen and list screen.(It is checked by standard.)
You can specify the minimum size and maximum size of the file to be uploaded.The unit is "Byte".
If it is less than the specified size or exceeds the specified size, an error message like the one shown in Fig. 22 will be displayed.
You can specify the extension of the file to be uploaded.Separate multiple items with a comma ",".
If it is not an acceptable file extension, an error message like the one shown in Figure 24 is displayed.
Open the automatically generated WEB-INF \ classes \ savedir.properties.UTF8 file with a text editor. It is described as follows.
# ライセンスファイル savedir.jfclicenseholder=../../upload_dir/jfclicenseholder # メールテンプレート savedir.jfcmailtemplate=../../upload_dir/jfcmailtemplate # 帳票テンプレート savedir.jfcreporttemplate=../../upload_dir/jfcreporttemplate # 顧客 savedir.customer=../../upload_dir/customer
By default, it is relative to the origin directory (wagbyapp \ bin).The save destination can be specified for each model.
Here, edit only the models that you want to change, leaving entries.For models that do not require change, delete the description from the original file. For example, if you only want to change the storage location for the "customer" model, it will be as follows.
# 顧客 savedir.customer=C://Users//YOURNAME//Desktop//newfolder
Save the edited file in the customize \ resources folder with the filename mysavedir.properties.UTF8.
If you create the mysavedir.properties.UTF8 file during operation, the following rule will be taken.
When you click on the file registered in the file type item to download it, the log is output.
2016-xx-xx 00:01:02 [INFO wagbyDownload2 _jspService] (admin) Download test.xls
When the type name of MIME type is text (text file, HTML file etc), "utf - 8" is the standard for character encoding.
You can also change the standard character encoding by specifying "environment> application> initial parameter> character encoding of download file".This will be unified throughout the project.
The standard for character encoding is Shift_JIS.You can not change this.