NetTalk Central

Author Topic: UPLOAD  (Read 4154 times)

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
UPLOAD
« 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
Walter - SOFTVALE

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: UPLOAD
« Reply #1 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

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: UPLOAD
« Reply #2 on: August 26, 2014, 09:30:27 AM »
Thanks Robert
Walter - SOFTVALE

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: UPLOAD
« Reply #3 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
Walter - SOFTVALE

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: UPLOAD
« Reply #4 on: August 26, 2014, 11:58:57 AM »
Check on Clarion help for RENAME. I think it should work.

Robert

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: UPLOAD
« Reply #5 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
   
Walter - SOFTVALE