Action attempting:
1. Upload a file to the A5 server using an embedded .a5w page in a dialog component;
2. save the file name to the dialog control reserved for the file name;
I have slightly modified a sample .a5w page I found in the wiki or msg board (can't remember which) as the basis for my embedded .a5w page. I am able to successfully upload the file to the server (and move the file from the session folder to a specified folder on the server in the afterDialogValidate event.)
However, I can not discover how to transfer the filename to the dialog control reserved for the name or save the path to the table field that is bound to the dialog control.
Embedded .a5w page:
Images of the dialog component:
UploadFile1-2.JPGUploadFile2-2.JPG
1. Upload a file to the A5 server using an embedded .a5w page in a dialog component;
2. save the file name to the dialog control reserved for the file name;
I have slightly modified a sample .a5w page I found in the wiki or msg board (can't remember which) as the basis for my embedded .a5w page. I am able to successfully upload the file to the server (and move the file from the session folder to a specified folder on the server in the afterDialogValidate event.)
However, I can not discover how to transfer the filename to the dialog control reserved for the name or save the path to the table field that is bound to the dialog control.
Embedded .a5w page:
Code:
<!DOCTYPE html> <html> <%a5 dim msg as c = "" if eval_valid("cmd") msg = "MSG 92487 - File Upload Failed" if FileToUpload.FileName <> "" session.UploadedFileName = session.session_folder + "\\" + FileToUpload.filename file.from_blob(session.UploadedFileName,FileToUpload.data) msg = "<a href=\"/" + FileToUpload.filename + "\" target=\"_blank\">" msg = msg + FileToUpload.filename + "</a> was uploaded<br /><br />" else msg = "Please specify file to upload" end if end if %> <head><title>File Upload example</title></head> <body bgcolor="#ffffff"> <%a5 ? msg %> <form action="fileupload.a5w" method="POST" enctype="multipart/form-data"> <input type="file" name="FileToUpload" value=""><br /> <input type="submit" name="cmd" value="Upload File"> </form> <!-- file.from_blob(ServerSetting.Document_Root + "\\" + FileToUpload.filename,FileToUpload.data) msg = "<a href=\"/" + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />" end if --> </body></html>
UploadFile1-2.JPGUploadFile2-2.JPG