NetTalk Central

Author Topic: File upload  (Read 4726 times)

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
File upload
« on: February 11, 2013, 12:52:25 AM »
Hello please can anyone help am on a deadline date today all I am stuck on at the moment is as foolows:
 Trying to use the new file upload methods in nettalk 7 to upload files . Here is what I have at the moment, I have created a folder in the upload directory called clientsdata and with this is another folder created within it and name as the id number from the client record.
Now here is the problem from what I understand I can have users upload files rename it and direct it to this folders from the form and not the webhandler. But I can not just get any of it to work, just totally lost on this one.
So please any help will be appreciated on this. Please anyone(and this will support multi-select)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: File upload
« Reply #1 on: February 11, 2013, 03:17:04 AM »
In web handler, in the p_web.RenameFile embed I use self.site.UploadsPath =  to direct my files and it seems to work.

make sure self.site.UploadsPath contains path only. I use st.PathOnly for this. If still not working stick some debug points in this embed to check your path etc




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: File upload
« Reply #2 on: February 11, 2013, 06:55:01 AM »
I think the Renamefile approach in WebHandler is now obsolete Kevin.

Olu, there's a SafeFile::FieldName routine generated in the form. In there you'll see the call to .SaveFile (which takes the file name). You can manipulate the file name there as you need to.

cheers
Bruce

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Re: File upload
« Reply #3 on: February 11, 2013, 07:00:48 AM »
Hi Bruce,
 Yes that was what I thought but it seems not to work, I have tried something like this in there:
Loc:filename = 'clientdata\2\test.jpg'
p_web.setvalue('Loc:filename',Loc:filename )

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: File upload
« Reply #4 on: February 11, 2013, 11:48:00 AM »
Olu,
The new file upload will not work unless the "file upload" field in NetWebForm template has the same value for both the "Field" and "Use Equate" fields or you have upgraded to NT 7.05.

Also your Loc:filename variable must have the file name with the complete path to the folder that you are updating. Relative path to the web folder will not work.

I hope these suggestions help you.

Rob