Upload Pictures to WebApp

Hi All,

I tried with a simple web app that can upload and save files to my Firebird database BLOB column. I have a few questions now:

  1. Is it possible to add more than one files at a time in the WebFileUploader (the + button)?
  2. Can I drag from Windows desktop and drop pictures to the WebFileUploader directly?
  3. If answer to Q2 is negative, can I add files to WebFileUploader by code? I want to let use to drop files in a textarea (or weblist if possible), then I can add the files to the Uploader by code.
  4. WebControl.AcceptPictureDrop requires a parameter ( acceptedActions As Integer ), what is acceptedActions?
  5. By doing nothing, if the user drag a file to my webapp, the web app change its page and show the file, how can I disable this?

Thanks a lot.

  1. Yes.
  2. No.
  3. No. That would require the app to have access to a computer that isn’t even hosting the app itself.
  4. I think this is standard behavior of a browser. Maybe it can be changed by JavaScript?

http://documentation.xojo.com/index.php/WebFileUploader

There was a discussion three years ago :
https://forum.xojo.com/11140-htmlviewer-file-drop/0

Does it mean things has to be done in all pages and dialog?

BTW, I think jQueryFileUpload of Web Custom Controls can help me in the file upload issue, will have it a try later.

Ouch. I just tried to download Shao Sean’s example project, and the link is no longer valid. Unfortunately, I have not kept a copy. Sorry.

This seems to address the issue :
http://stackoverflow.com/questions/6756583/prevent-browser-from-loading-a-drag-and-dropped-file#6756680

And, yes, it would have to be added to each WebPage. I don’t think that would be necessary for dialogs. The listener should block drop files for the whole WebPage, including dialogs. But you may want to experiment.

Hello.
Is there a current sample for this in 2018R1.1? I did not see one…
Tim

Is it possible to add more than one files at a time in the WebFileUploader (the + button)? How ?

Yes. Set the WebFileUploader.MultiSelect property to True.

https://documentation.xojo.com/api/user_interface/web/webfileuploader.html.MultiSelect

Can I drag from Windows desktop and drop pictures to the WebFileUploader directly? --> No???

Issues with Xojo Web are browser specific. Drag and drop is working here on macOS 10.14.2 and Firefox. When having issues with Xojo Web it is essential to let them know which web browser and OS you are using when you file a bug report :slight_smile:

https://documentation.xojo.com/api/user_interface/web/webfileuploader.html

Works for me with Chrome on Windows.

Its not possible using the standard uploader.

but! you can “easily” write your own Upload-Control, which loads the file to your server after the drop. Done several times on the Internet. What you have to do in xojo is, that your control receives the native paths of the uploaded files.

I think I’ve seen this before also implemented in xojo, maybe in Jeremy Leroy control library.