NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: bijan on May 22, 2015, 05:37:27 AM

Title: Rename the uploaded file
Post by: bijan 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
Title: Re: Rename the uploaded file
Post by: bijan 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