PDA

View Full Version : cWebFileUploadButton file exists



chuckatkinson
20-Apr-2014, 04:40 PM
If a file already exists in the destination - what would be the preferred method to avoid a nasty Error 999 message popup. I want to give the user the option to cancel the upload and do something else.



Function OnFileUpload String sFileName Integer iBytes String sMime Returns String
String sUsrImagePath sPath
Boolean bExists
Get psUsrImagePath of oApplication to sUsrImagePath
Move (sUsrImagePath + sFileName) to sPath
File_Exist sPath bExists
If (bExists) Begin
Send ShowYesNo (Self) (RefProc(ConfirmAddImage)) "Do you want to add it to this user part? " "Image already uploaded"
End
Function_Return sPath
End_Function


But I don't see how to cancel the uploading process. Also it would help if there was a property in the class of the current file in the upload process.

EDIT: Seems if I move '' to sPath then it will cancel the upload - but then I get this default message which I would like to optionally suppress.

7622

Harm Wibier
21-Apr-2014, 05:10 AM
Hi Chuck,

That dialog isn't supposed to be in there like this at all. Not sure what the control should do there (maybe nothing indeed) but something for us to look into.

Regards,

chuckatkinson
21-Apr-2014, 06:27 AM
Line 443 in WebBaseFileUpload.js has the alert.

EDIT: However this is in df-min.js so I can't easily turn it off.

Harm Wibier
21-Apr-2014, 07:47 AM
You could replace the function its in from a separate package but as this is still beta software I'd advice to wait for us to change it ;).

Gregg Finney
21-Apr-2014, 08:00 AM
Chuck I think your checking if file exists to late. How about checking in the procedure StartUpLoad.

chuckatkinson
21-Apr-2014, 08:22 AM
Thanks Gregg - I'll take a look.

chuckatkinson
21-Apr-2014, 11:46 AM
How about checking in the procedure StartUpLoad.

I don't think this is a published procedure?

Gregg Finney
3-May-2014, 09:05 AM
Chuck,
Did you come up with a solution for this? Looking at the classes seems really bare bones.

chuckatkinson
4-May-2014, 06:57 AM
It was fixed in the asp in the beta 3 build. I figured out how to get around the file exist problem. It was the alert in the asp that was annoying. That is now fixed.