Re: [WebDNA] Write uploaded file with same name

This WebDNA talk-list message is from

2020


It keeps the original formatting.
numero = 115071
interpreted = N
texte = 2700 --Apple-Mail=_8AD6CE17-6B77-478B-B7F5-9C75CF367D7A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Ken, Stuart=E2=80=99s method works because for a form input such as: The server will see this header, where the name of the file is supplied = by =E2=80=9Cfilename=E2=80=9D: Content-Disposition: form-data; name=3D"uploadedfile"; = filename=3D=E2=80=9Cmy.jpg=E2=80=9D This entire line of text is received by WebDNA in [formvariables] as = the [name], while the binary file itself is supplied in the [value]. MD > On Mar 25, 2020, at 3:52 PM, talk@webdna.us wrote: >=20 > Hi Ken >=20 > I have stripped this out of a working file. >=20 > [FORMVARIABLES name=3D_FILEUPLOAD&exact=3DF][!] > [/!][HIDEIF [URL][value][/URL]=3D][!] > ------------------------------------ > [/!][SHOWIF [url][name][/url]^[url]filename=3D"[/url]][!] > [/!][TEXT]FULLFILENAME=3D[MIDDLE = StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEXT][!] > -------------- write the file to upload dir = -------------- > [/!][HIDEIF [FULLFILENAME]=3D][!] > [/!][WRITEFILE = secure=3DF&file=3D[SHORTPATH]/[CompanyID]/[THISFILENAME]][value][/WRITEFIL= E][!] > [/!][/HIDEIF][!] > [/!][/SHOWIF][!] > ------------------------------------ > [/!][/HIDEIF][!] > [/!][/FORMVARIABLES] >=20 > However because people do put all sorts of characters in file names I = always clean the name before using it. >=20 >=20 >=20 >=20 > Kind regards >=20 > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au >=20 >=20 >=20 >=20 >=20 >=20 >=20 >> On 26 Mar 2020, at 09:43, talk@webdna.us = wrote: >>=20 >> My client is uploading a file via http. How do I write the >> file on my server with the same name as on the client's >> computer? >>=20 >> In other words, is there a reliable way to extract the >> original file name from the uploaded data? >>=20 >> Regards, >> Kenneth Grome >> WebDNA Solutions >> http://www.webdnasolutions.com >> Urgent/Emergency Phone: (228) 222-2917 >> Website, Database, Network, and Communication Systems >>=20 >>=20 >>=20 >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list talk@webdna.us >> To unsubscribe, E-mail to: talk-leave@webdna.us >> archives: http://www.webdna.us/page.dna?numero=3D55 >> Bug Reporting: support@webdna.us >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list = talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: = http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: = support@webdna.us --Apple-Mail=_8AD6CE17-6B77-478B-B7F5-9C75CF367D7A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Ken,

Stuart=E2=80=99s method works because for a form input such = as:
<input =type=3D=E2=80=9Cfile=E2=80=9D =name=3D=E2=80=9Cuploadedfile=E2=80=9D>
The = server will see this header, where the name of the file is supplied by = =E2=80=9Cfilename=E2=80=9D:

Content-Disposition: form-data; name=3D"uploadedfile"; =filename=3D=E2=80=9Cmy.jpg=E2=80=9D
This entire line of text is = received by WebDNA  in [formvariables] as the [name], while the = binary file itself is supplied in the [value].


MD

On Mar 25, 2020, at 3:52 PM, talk@webdna.us wrote:

Hi Ken

I have stripped this out = of a working file.

[FORMVARIABLES = name=3D_FILEUPLOAD&exact=3DF][!]
= [/!][HIDEIF [URL][value][/URL]=3D][!]
= ------------------------------------
= [/!][SHOWIF [url][name][/url]^[url]filename=3D"[/url]][!]
= [/!][TEXT]FULLFILENAME=3D[MIDDLE = StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEXT][!]
= -------------- write the file to upload = dir --------------
[/!][HIDEIF = [FULLFILENAME]=3D][!]
= [/!][WRITEFILE = secure=3DF&file=3D[SHORTPATH]/[CompanyID]/[THISFILENAME]][value][/WRIT= EFILE][!]
= [/!][/HIDEIF][!]
= [/!][/SHOWIF][!]
= ------------------------------------
= [/!][/HIDEIF][!]
[/!][/FORMVARIABLES]

However because people do put all sorts = of characters in file names I always clean the name before using = it.




Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA







On 26 Mar 2020, at 09:43, talk@webdna.us wrote:

My = client is uploading a file via http. How do I write the
file= on my server with the same name as on the client's
computer?

In other words, is = there a reliable way to extract the
original file name = from the uploaded data?

Regards,
Kenneth Grome
WebDNA Solutions
http://www.webdnasolutions.com
Urgent/Emergency Phone: (228) 222-2917
Website, = Database, Network, and Communication Systems



---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list talk@webdna.us
To unsubscribe, E-mail to: = talk-leave@webdna.us
archives: http://www.webdna.us/page.dna?numero=3D55
Bug= Reporting: support@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us

= --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --Apple-Mail=_8AD6CE17-6B77-478B-B7F5-9C75CF367D7A-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Write uploaded file with same name (Stuart Tremain 2020)
  2. Re: [WebDNA] Write uploaded file with same name (Michael Davis 2020)
  3. Re: [WebDNA] Write uploaded file with same name (Stuart Tremain 2020)
  4. [WebDNA] Write uploaded file with same name (WebDNA Solutions 2020)
2700 --Apple-Mail=_8AD6CE17-6B77-478B-B7F5-9C75CF367D7A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Ken, Stuart=E2=80=99s method works because for a form input such as: The server will see this header, where the name of the file is supplied = by =E2=80=9Cfilename=E2=80=9D: Content-Disposition: form-data; name=3D"uploadedfile"; = filename=3D=E2=80=9Cmy.jpg=E2=80=9D This entire line of text is received by WebDNA in [formvariables] as = the [name], while the binary file itself is supplied in the [value]. MD > On Mar 25, 2020, at 3:52 PM, talk@webdna.us wrote: >=20 > Hi Ken >=20 > I have stripped this out of a working file. >=20 > [FORMVARIABLES name=3D_FILEUPLOAD&exact=3DF][!] > [/!][HIDEIF [url][value][/URL]=3D][!] > ------------------------------------ > [/!][SHOWIF [url][name][/url]^[url]filename=3D"[/url]][!] > [/!][text]FULLFILENAME=3D[MIDDLE = StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEXT][!] > -------------- write the file to upload dir = -------------- > [/!][HIDEIF [FULLFILENAME]=3D][!] > [/!][WRITEFILE = secure=3DF&file=3D[SHORTPATH]/[CompanyID]/[THISFILENAME]][value][/WRITEFIL= E][!] > [/!][/HIDEIF][!] > [/!][/SHOWIF][!] > ------------------------------------ > [/!][/HIDEIF][!] > [/!][/FORMVARIABLES] >=20 > However because people do put all sorts of characters in file names I = always clean the name before using it. >=20 >=20 >=20 >=20 > Kind regards >=20 > Stuart Tremain > Pharoah Lane Software > AUSTRALIA > webdna@plsoftware.com.au >=20 >=20 >=20 >=20 >=20 >=20 >=20 >> On 26 Mar 2020, at 09:43, talk@webdna.us = wrote: >>=20 >> My client is uploading a file via http. How do I write the >> file on my server with the same name as on the client's >> computer? >>=20 >> In other words, is there a reliable way to extract the >> original file name from the uploaded data? >>=20 >> Regards, >> Kenneth Grome >> WebDNA Solutions >> http://www.webdnasolutions.com >> Urgent/Emergency Phone: (228) 222-2917 >> Website, Database, Network, and Communication Systems >>=20 >>=20 >>=20 >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list talk@webdna.us >> To unsubscribe, E-mail to: talk-leave@webdna.us >> archives: http://www.webdna.us/page.dna?numero=3D55 >> Bug Reporting: support@webdna.us >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list = talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: = http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: = support@webdna.us --Apple-Mail=_8AD6CE17-6B77-478B-B7F5-9C75CF367D7A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Ken,

Stuart=E2=80=99s method works because for a form input such = as:
<input =type=3D=E2=80=9Cfile=E2=80=9D =name=3D=E2=80=9Cuploadedfile=E2=80=9D>
The = server will see this header, where the name of the file is supplied by = =E2=80=9Cfilename=E2=80=9D:

Content-Disposition: form-data; name=3D"uploadedfile"; =filename=3D=E2=80=9Cmy.jpg=E2=80=9D
This entire line of text is = received by WebDNA  in [formvariables] as the [name], while the = binary file itself is supplied in the [value].


MD

On Mar 25, 2020, at 3:52 PM, talk@webdna.us wrote:

Hi Ken

I have stripped this out = of a working file.

[FORMVARIABLES = name=3D_FILEUPLOAD&exact=3DF][!]
= [/!][HIDEIF [url][value][/URL]=3D][!]
= ------------------------------------
= [/!][SHOWIF [url][name][/url]^[url]filename=3D"[/url]][!]
= [/!][text]FULLFILENAME=3D[MIDDLE = StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEXT][!]
= -------------- write the file to upload = dir --------------
[/!][HIDEIF = [FULLFILENAME]=3D][!]
= [/!][WRITEFILE = secure=3DF&file=3D[SHORTPATH]/[CompanyID]/[THISFILENAME]][value][/WRIT= EFILE][!]
= [/!][/HIDEIF][!]
= [/!][/SHOWIF][!]
= ------------------------------------
= [/!][/HIDEIF][!]
[/!][/FORMVARIABLES]

However because people do put all sorts = of characters in file names I always clean the name before using = it.




Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA







On 26 Mar 2020, at 09:43, talk@webdna.us wrote:

My = client is uploading a file via http. How do I write the
file= on my server with the same name as on the client's
computer?

In other words, is = there a reliable way to extract the
original file name = from the uploaded data?

Regards,
Kenneth Grome
WebDNA Solutions
http://www.webdnasolutions.com
Urgent/Emergency Phone: (228) 222-2917
Website, = Database, Network, and Communication Systems



---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list talk@webdna.us
To unsubscribe, E-mail to: = talk-leave@webdna.us
archives: http://www.webdna.us/page.dna?numero=3D55
Bug= Reporting: support@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us

= --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --Apple-Mail=_8AD6CE17-6B77-478B-B7F5-9C75CF367D7A-- . Michael Davis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

RE: Nesting [ListFiles] (1998) Exclamation (2002) Configuring E-mail (1997) Emailer Error 550 (Was Strange Crash) (1998) WebDNA Verison 4.5 will Not Restart! This SUCKS! (2002) SetLineItem (1997) Is this possible, WebCat2.0 and checkboxes (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Limit picture size on upload (2005) WebCatalog and WebMerchant reviewed by InfoWorld (1997) RE: [sendmail]- bcc? (1998) New command suggestion (1997) Re[2]: WebCatalog keeps quiting on Solaris, and support isn' (2000) Editing the search string (1997) Check if file exists (2000) What about this gremlin issue? (2000) Cookie still not working (1999) Buying sans cart (1997) Still Stumped on ShowNext...HELP! (1997) ShowNext (1997)