NetTalk Central

Author Topic: Rename the uploaded file  (Read 3169 times)

bijan

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Email
Rename the uploaded file
« on: May 22, 2015, 05:37:27 AM »
Hi,

I like to rename the file name in one of my forms prior to saving to the upload folder. Where is the best place to do this?

Regards

Bijan

bijan

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Email
Re: Rename the uploaded file
« Reply #1 on: May 22, 2015, 09:42:34 AM »
Hi Bruce,

Thanks for doing the weekly webinars.
I found the solution in the March 2015 webinar. :)
In case someone needs it, If you use String Theory you can do the following in the savefile routine:

    loc:Name = st.FileNameOnly(loc:Picture)
    loc:Path = st.Pathonly(loc:Picture)
    loc:Ext  = st.ExtensionOnly(loc:Picture)
    loc:Picture = Clip(loc:Path) & '\' & 'newfilename.' & loc:Ext
    p_web.SSV('loc:Picture',loc:Picture)

In my case I don't need to save the path/file name in any record. I just need to upload it.

HTH
« Last Edit: May 22, 2015, 09:56:08 AM by bijan »