the user selects the file i.e. a photo,
the procedure must rename the photo with the student's matriculation number (nMatricola)
I made :
Code: Select all | Expand
nMatricola:= oAlunno:matricola // student's matriculation number
cExt := ltrim(Right(cfotografia,4)) // the extension of file
cRelativePath:= RelativePath(cfotografia) // give the folder of file loaded
cFileNew:=cRelativePath+alltrim(nMatricola)+cExt //save the new name file with extension
Code: Select all | Expand
while FRename( cfotografia, cFileNew ) != 0
SysWait()
end
Code: Select all | Expand
AaDd(aSource,(cFileNew) )
AaDD(aTarget,cImgPath+UrlImage(cFileNew))
CopyFiles(aSource,aTarget,)
Code: Select all | Expand
oAlunno:foto:= UrlImage(cFileNew)
oAlunno:Save()
the function RelativePath() - it gives me the name of the folder without the file
the function UrlImage() - it gives me the file name without the folder name
How I can resolve it ?