Upload - File transfers from the Web client to server
object allows to provide a html page with a form that allows the client to select file(s) located on the Web client computer and send them to server.
Page template (upload.htm):
<h2>Select a file to upload to the server</h2>
<form enctype="multipart/form-data" method="post" action="#">
File to upload: <input id="fileupload" name="myfile" type="file" multiple/><hr/>
<input type="submit" id="submit" value="Upload to server"/>
The page can also be created in the script in the onPageModify
event if the "Data source
" configurator is set to Text set into the pEvent.PageString property in the onPageModify event
. Such approach is used in the preconfiguration Preconfiguration "PmaWebDir - Uploading files from Web client to server"
Opening the page:
Script in the onButtonUp
event of the PmgButton
object that opens the upload.htm
page of the PmaWebDir
object that can be used for sending the file to server.
Pm.CreateView(pMe.PmPanel, "/Web/Dir", "file:upload.htm", "target:_blank;").Open();