Re: [WebDNA] Write uploaded file with same name

This WebDNA talk-list message is from

2020


It keeps the original formatting.
numero = 115072
interpreted = N
texte = 2701 --Apple-Mail=_D247FF87-F507-4C64-99E3-70659F8720B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Actually the form input is: Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au > On 26 Mar 2020, at 10:10, talk@webdna.us wrote: >=20 > Ken, >=20 > 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: >=20 > 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]. >=20 >=20 > MD >=20 >> 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 > --------------------------------------------------------- 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=_D247FF87-F507-4C64-99E3-70659F8720B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Actually the form input is:

<input type=3D=E2=80=9Cfile=E2=80=9D name=3D"_FILEUPLOAD">

Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA







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

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

= --------------------------------------------------------- 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=_D247FF87-F507-4C64-99E3-70659F8720B1-- . 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)
2701 --Apple-Mail=_D247FF87-F507-4C64-99E3-70659F8720B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Actually the form input is: Kind regards Stuart Tremain Pharoah Lane Software AUSTRALIA webdna@plsoftware.com.au > On 26 Mar 2020, at 10:10, talk@webdna.us wrote: >=20 > Ken, >=20 > 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: >=20 > 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]. >=20 >=20 > MD >=20 >> 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 > --------------------------------------------------------- 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=_D247FF87-F507-4C64-99E3-70659F8720B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Actually the form input is:

<input type=3D=E2=80=9Cfile=E2=80=9D name=3D"_FILEUPLOAD">

Kind regards

Stuart Tremain
Pharoah Lane Software
AUSTRALIA







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

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

= --------------------------------------------------------- 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=_D247FF87-F507-4C64-99E3-70659F8720B1-- . Stuart Tremain

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:

Secure server question (1997) Signal Raised Error (Part II) (1997) Bad suffix error (1997) RE: textA and Title? (1997) 2 things: CartSweep and Manual (2003) WebCat table size. (2001) Re[3]: 2nd WebCatalog2 Feature Request (1996) WebCat2: Formulas.db question (1997) Running _every_ page through WebCat ? (1997) sku not found (1997) Dark Horse Comics success story (1997) WebCommerce: Folder organization ? (1997) taxTotal problem (1998) [WebDNA] inputed text getting scrambled up in DB (2012) OH MY GOD! (1998) NT BETA BUG???? (1997) PCS Frames (1997) Authenticate (1997) system crashes, event log (1997) OT: automating a POST (2002)