ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Web-specific functions / Upload functions
  • Adding the image of a contact
UploadCopyFile (Example)
Adding the image of a contact
WEBDEV - Server codePHPAjax
sImagePath is string
PageToFile(PAGE_New_Contact, File_Contact)
 
// Manage the image of the contact
IF EDT_IMAGE <> "" THEN
sImagePath = UploadCopyFile(EDT_IMAGE, fDataDir(), "")
IF sImagePath = "" THEN
 Error("Error while transferring the image to the server. Process canceled.")
 RETURN
ELSE
 IF NOT HLinkMemo(File_Contact, Photo, ...
CompleteDir(fDataDir()) + sImagePath) THEN
 Error(HErrorInfo())
 RETURN
 END
END
END
 
IF HAdd(File_Contact) = False THEN
Error(HErrorInfo())
END
 
// Delete the uploaded file
fDelete(CompleteDir(fDataDir()) + sImagePath)
PageDisplay(PAGE_List_of_Contacts)
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help