I need to save a file in the archive with the extension ( I not Know wich is the extension of the file) ,
the user selects the file i.e. a photo,
the procedure must rename the photo with the student's matriculation number (nMatricola)
I made :
to rename the file cfotografia into new file cFileNew I made
to save I use the copyfile function (found in fwh sample)
it happens that sometimes it works and sometimes it saves the file in the cImgPath folder without extension but only with the file name i.e. with the student's matriculation number (nmatricola) and then saves it in the oAlunno:foto field
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 ?
the user selects the file i.e. a photo,
the procedure must rename the photo with the student's matriculation number (nMatricola)
I made :
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 while FRename( cfotografia, cFileNew ) != 0
SysWait()
endAaDd(aSource,(cFileNew) )
AaDD(aTarget,cImgPath+UrlImage(cFileNew))
CopyFiles(aSource,aTarget,) 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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com