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
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