NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: walter.dasilva on August 26, 2014, 05:15:40 AM

Title: UPLOAD
Post 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
Title: Re: UPLOAD
Post by: Robert Iliuta on August 26, 2014, 07:25:58 AM
Hallo Walter,


The embed is on WebHandler: RenameFile > before Parent Call

Code: [Select]
! 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
Title: Re: UPLOAD
Post by: walter.dasilva on August 26, 2014, 09:30:27 AM
Thanks Robert
Title: Re: UPLOAD
Post by: walter.dasilva on August 26, 2014, 10:28:45 AM
Hi Robert,

Do you know how do i to move file to another folder (inside web folder)?

Regards
Walter - SOFTVALE
Title: Re: UPLOAD
Post by: Robert Iliuta on August 26, 2014, 11:58:57 AM
Check on Clarion help for RENAME. I think it should work.

Robert
Title: Re: UPLOAD
Post by: walter.dasilva on August 26, 2014, 12:38:40 PM
   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