NetTalk Central

Author Topic: Upload files to different folder  (Read 3804 times)

estadok

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • EstaSoft
    • Email
Upload files to different folder
« on: January 20, 2013, 09:54:06 AM »
Hi!

What i'm doing wrong?
Code: [Select]
p_web.RenameFile PROCEDURE(STRING p_name,STRING p_filename,<String p_path>)

ReturnValue          ANY

! Start of "NetTalk Method Data Section"
! [Priority 5000]

! End of "NetTalk Method Data Section"

  CODE

 
  IF SELF.GSV('glo:agreement') = 0
     p_path = clip(self.site.WebFolderPath) & '\uploads\' &self.GSV('KLIF:Phone')
   ELSE
     p_path = clip(self.site.WebFolderPath) & '\uploads\agreements'
     SELF.SSV('glo:agreement',0)
  .
  ! Parent Call
  ReturnValue = PARENT.RenameFile(p_name,p_filename,p_path)
  ! [Priority 7500]

  SELF._Trace(ReturnValue)
  self.site.UploadsPath = clip(self.site.WebFolderPath) & '\uploads'

  RETURN ReturnValue

SELF._Trace(ReturnValue) this method returns the correct path to file, but file don't apears in folder... What is wrong in this code?
Clarion 9.0.10376
NetTalk 7.26
SecWin 6.25
StringTheory 1.92

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Upload files to different folder
« Reply #1 on: January 21, 2013, 05:12:49 AM »
Don't change the parameter p_path, but propertie self.site.UploadsPath before Parent Call

So, try:

p_web.RenameFile PROCEDURE(STRING p_name,STRING p_filename,<String p_path>)

ReturnValue          ANY

! Start of "NetTalk Method Data Section"
! [Priority 5000]

! End of "NetTalk Method Data Section"

  CODE

 
  IF SELF.GSV('glo:agreement') = 0
     self.site.UploadsPath = clip(self.site.WebFolderPath) & '\uploads\' &self.GSV('KLIF:Phone')
   ELSE
     self.site.UploadsPath = clip(self.site.WebFolderPath) & '\uploads\agreements'
     SELF.SSV('glo:agreement',0)
  END
  ! Parent Call
  ReturnValue = PARENT.RenameFile(p_name,p_filename,p_path)
  ! [Priority 7500]

  SELF._Trace(ReturnValue)
  self.site.UploadsPath = clip(self.site.WebFolderPath) & '\uploads'

  RETURN ReturnValue

Regards,
Matthew

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Upload files to different folder
« Reply #2 on: January 21, 2013, 10:45:24 PM »
Hi there,

I use a two-step (basic) method.

1. Wait for the file to be uploaded to the default upload folder, then

2. Move (rename) the file to whereever (in the web folder) I want.
Cheers,

Stu Andrews

estadok

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • EstaSoft
    • Email
Re: Upload files to different folder
« Reply #3 on: January 22, 2013, 10:01:28 AM »
Thanks for advice! Both of these methods are work fine! :)
Clarion 9.0.10376
NetTalk 7.26
SecWin 6.25
StringTheory 1.92