Jump to content

TUniFileUpload - allow upload of user's selected files to be performed from code


Tim
 Share

Recommended Posts

We are building a wizard-style application which allows customers to submit orders. On the first page of the wizard the customer chooses files to be uploaded; the following pages gather various information about the order. The files selected on the first page should only be uploaded when the user clicks the Finish button on the final page of the wizard. This doesn't seem to be possible with the current TUniFileUpload control. Calling TUniFileUpload.Execute causes a modal Upload dialog to be displayed. After choosing a file, the user has two options: Upload and Cancel. Upload performs the upload immediately; Cancel clears the filename. We would like for the user to be able to close the modal dialog without either of these two things happening, i.e. the TUniFileUpload control should retain the filename selected by the user, so that the upload can be performed later in the OnClick event of the wizard's Finish button. The code would look something like the following:

procedure TMainForm.FinishButtonClick(Sender: TObject);
begin
  UniFileUpload1.PerformUpload();
end;

I hope that makes sense :)

 

This is possibly a duplicate of the following (somewhat older) feature request:

 

http://forums.unigui.com/index.php?/topic/862-how-to-show-a-open-file-dialog/&do=findComment&comment=2325

 

For us at least being able to perform uploads in this fashion would be a really useful feature :)

 

  • Upvote 1
Link to comment
Share on other sites

 

We are building a wizard-style application which allows customers to submit orders. On the first page of the wizard the customer chooses files to be uploaded; the following pages gather various information about the order. The files selected on the first page should only be uploaded when the user clicks the Finish button on the final page of the wizard. This doesn't seem to be possible with the current TUniFileUpload control. Calling TUniFileUpload.Execute causes a modal Upload dialog to be displayed. After choosing a file, the user has two options: Upload and Cancel. Upload performs the upload immediately; Cancel clears the filename. We would like for the user to be able to close the modal dialog without either of these two things happening, i.e. the TUniFileUpload control should retain the filename selected by the user, so that the upload can be performed later in the OnClick event of the wizard's Finish button. The code would look something like the following:

procedure TMainForm.FinishButtonClick(Sender: TObject);
begin
  UniFileUpload1.PerformUpload();
end;

I hope that makes sense :)

 

This is possibly a duplicate of the following (somewhat older) feature request:

 

http://forums.unigui.com/index.php?/topic/862-how-to-show-a-open-file-dialog/&do=findComment&comment=2325

 

For us at least being able to perform uploads in this fashion would be a really useful feature :)

 

 

you can change the code from this example, here you find the essential functions which we expect when uploading file(s):

 

http://forums.unigui.com/index.php?/topic/4305-uniguifineuploader/

 

brfc

Link to comment
Share on other sites

Thanks for the pointer!

 

It is not quite clear to me how one would adapt the code in the sample project under post #21050 (http://forums.unigui.com/index.php?/topic/4305-uniguifineuploader/&do=findComment&comment=21050) to initiate the upload from the OnClick of a TUniButton rather than clicking on the buttons in the file upload control itself. Presumably there is a javascript function I have to call somewhere?

 

For our current project we probably will end up writing our own javascript code to allow the user to choose files and to perform uploads. I just thought it would be good to enter this feature request.

Link to comment
Share on other sites

 Share

×
×
  • Create New...