NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: walter.dasilva on August 26, 2014, 05:15:40 AM
-
Hi,
How to change upload folder. I need one upload folder for customer and one upload folder for suppliers.
How to change the name of file and save the relative filename for each upload folder?
Thanks
Walter - SOFTVALE
-
Hallo Walter,
The embed is on WebHandler: RenameFile > before Parent Call
! RECEIVE TPS OR PHOTOS
!-----------------------------------------------
CASE xExtractExt(clip(UPPER(p_filename)))
! Here you can put your condition
! I check for extension, but you can check for anything else
OF 'TPS'
OF 'JPEG' orof 'BMP' orof 'PNG'
!do nothing
OF 'JPG'
!SSV name photo and path
!--------------------------------------
IF p_name = 'l:UploadFile' !this is the name of upload variable
!Here you change the upload folder
g:NEWPhotoALL = clip(self.site.WebFolderPath) &'\poze\'& p_web.GSV('MEM:ID_Membru') &'.JPG'
p_filename = ''
ReturnValue = Parent.RenameFile(p_name,p_filename,g:NEWPhotoALL)
RETURN ReturnValue
END
END
Robert
-
Thanks Robert
-
Hi Robert,
Do you know how do i to move file to another folder (inside web folder)?
Regards
Walter - SOFTVALE
-
Check on Clarion help for RENAME. I think it should work.
Robert
-
IF p_name = 'Ass:Logo' !this is the name of upload variable
!Here you change the upload folder
st.SetValue(p_web.GSV('Ass:Codigo')&st.FileNameOnly(p_filename,0),st:Clip)
cs.MakeHash(st,cs:CALG_SHA1)
loc:sv__UploadFileName = clip(self.site.WebFolderPath) &'\uploads\associacao\'& st.GetValue() &'.'& st.ExtensionOnly(p_filename)
p_filename = ''
ReturnValue = Parent.RenameFile(p_name,p_filename,loc:sv__UploadFileName)
RETURN ReturnValue
END