PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WB22] Upload control
[WB22] Upload control
Débuté par Piet van Zanten, 16 nov. 2017 13:51 - 12 réponses
Posté le 16 novembre 2017 - 13:51
Hi,

I'm playing with the html 5 upload control, but I cannot get the drag and drop from the explorer to work.
Selecting and uploading multiple files from the filepicker works fine.
I did set the dnd option of the file list to accept, but that made no difference the cursor is always a forbid sign when hovering the list.
Anyone got this working?

Kind regards,
Piet
Posté le 16 novembre 2017 - 14:14
Hi Piet

yep... got it working all right... Didn't have the time to understand all the details, so I took the working example provided and used it as a base... just modified the code dealing with what happens to the files once they are on the server.

Best regards
Posté le 16 novembre 2017 - 16:25
Thanks Fabrice,

I took the control from the create button option on the Creation tab.
Now I also tested the Example and drag and drop works on this one.
The difference seems to be the page.
On the example the cursor is a copy cursor on the entire page, in my test page it's a forbid sign on the entire page.
The page is HTML 5 though, the only difference is that it's dynamic, not awp.
But I tested my page in AWP mode too and that didn't work either.

Kind regards,
Piet
Posté le 16 novembre 2017 - 16:32
But when I uncheck AWP mode in the Webdev example there's no more drag and drop avialable.
It seems dynamic non-awp pages do not accept any dnd :confused:
Posté le 16 novembre 2017 - 17:16
Hi,

This is really weird.

If I open a dynamic Webdev site from the web, I can drag any file into the browser (Chrome).
If I open the same Webdev site from the WB editor on localhost I get the forbid sign. If I open site A in a second tab from the same browser I get the forbid sign too.
But an awp page started from the WB environment does allow dnd.

There must be some local browser setting that prevents dnd locally on dynamic non awp pages but I have no clue.

Kind regards,
Piet
Posté le 16 novembre 2017 - 19:13
sorry I cannot be of more help...

I can only tell you that I'm using that in a classic webdev site, and the drag and drop works both in test mode and deployed without any problem... tested on chrome and firefox (don't remember if I tested in edge)

Best regards
Posté le 16 novembre 2017 - 21:51
Hi,

I found the cause of the problem.
There's a security issue that prevents files to be dragged into the browser when running the browser as administrator.
As I'm running Webdev as administrator to avoid annoying questions from UAC, so the browser is also running as administrator when in test mode. Hence the problem.

Kind regards,
Piet
Posté le 16 novembre 2017 - 22:01
And the solution:
- First start the browser outside Webdev
- Run Go, the page will be opened on a new tab in the already open browser, not running as administrator.
Now d&d is possible.
Posté le 17 novembre 2017 - 08:40
Thanks Piet,

I just planned an upgrade for next week to replace the flash-upload to the html5 upload on one of my customers webapps. Most probably you saved me some time :spos:
Posté le 17 novembre 2017 - 12:53
Hi Piet,

good to know... but what UAC problems? I'm running all pcsoft products as a regular user, and I do not have any uac messages popping up...

Best regards
Posté le 17 novembre 2017 - 15:50
Hi Fabrice,

My settings for UAC are standard, I used to have a message (in WB19 already) when WB started and each time I ran a test.
I got rid of this by creating a task in the task scheduler, with a shortcut on the desktop to start this task, running with maximum rights.
I automatically applied this solution to each new version.
To my surprise when I just tried to run WB as a normal user, no messages at all :confused:

Kind regards,
Piet
Posté le 18 novembre 2017 - 13:46
Hi Piet

maybe you chose to install that version the 'standard' windows way (ie with some of the program in the program files directory)

I always install everything in one directory, and that directory is never in program files, so that may account for the different behavior

Best regards
Posté le 18 novembre 2017 - 20:04
Hi Fabrice,

Funny thing is that the last installation is actually in the Program Files folder.
I always did it in a unique directory too.
Still have an occasional UAC question, but that is only on first start of Webdev, no more on consecutive starts as long as the computer stays on.
So either Windows has evolved to "remember" an allowed program or Webdev has evolved to handle UAC better, who knows.

Kind regards,
Piet