Web 1.0 Questions on WebFileUploder

To all of you Xojo users, a Happy New Year, the health, plenty of projects and to Xojo Inc., the best year ever.

I am working on a MacBook Pro 16" M1 Pro with Xojo 2019 r3.2. In the WebApp I am developing, the user needs to upload files to the back end database. My conclusion is that the WebFileUploader is the best way to achieve the goal. I based my code on the included WebFileUploader project.

I use 5 small files to to do the testing, the largest being 279 KB. When I upload the files I don’t see the Progress Bar, my guess is that the client is not updated until the upload is finished. I set breakpoints on UploadProgress and it’s never called ?!? Only UploadComplete fires when all files have been uploaded. Seems impossible to update the user during the process execution. Looking at the argument for UploadComplete event, all of the path to the files is a long number, so I guess that all files are in memory.

Are my assumptions right: I have to wait till the end of the process to learn the outcome of the operation ?

Another question: if the user closes the page, in this case a Dialog, without uploading the files, I can in now way bring back the previous selection so he can delete some files add some more ?

Thanks

With files that small, it’s unlikely that you’ll get any progress events at all. Reality is that they’ll upload pretty much instantaneously unless the user is on a really slow connection.

WebFileUploader.FileCount as per documentation:

The number of files that have been uploaded.

(Emphasized is mine). Not sure that is true, seems to be the number of files in the listbox that wait to be updated. Is there an error in the documentation ?

The UploadedCompleted events provides an array of uploaded files that would tell how many files were uploaded.

FileCount is the number of files that have been added, not uploaded.

Hi Greg,

here is another question. In the documentation for WebUploadedFile.Data, the type of value returned is not specified clearly - at least not for me :thinking:

StringValue = aWebUploadedFile .Data

To me it seems to be binary data, so maybe a Variant. I don’t get what’s the meaning of StringValue is.

Thanks

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.