Hello everyone,
Here’s the code I put in UploadFinished
But as there will be several sessions at the same time and users will send their photo taken with their smartphone, the name of the file will be by default “image.jpg”, so I would like to add code so that before saving, check if there is not a file with the same name and if so add the time, minutes, seconds or other name to make them unique, do you have an idea?
Thank you very much!
Dim uploadFolder As folderItem
uploadFolder = App.ExecutableFile.Parent.Child(“UploadedPictures”)
If Not uploadFolder.Exists Then
#If DebugBuild Then
uploadFolder.CreateFolder
#Else
MsgBox(“Upload failed”)
Return
#Endif
End IfDim uploadedPicture As Picture
Dim savePicture As FolderItemFor Each uFile As WebUploadedFile In files
Try
If uFile.file <> Nil Then
uploadedPicture = Picture.Open(uFile.File)
Else
uploadedPicture = Picture.FromData(uFile.data)
End If// Save the file to disk savePicture = uploadFolder.Child(uFile.Name) uFile.Save(savePicture)
Catch err As IOException
Exit For
End Try
NextMessageBox(“ok”)
1 post - 1 participant