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:

Virtual hosting and webcatNT (1997) aaron kant add (2.x) (2000) How to show via drop down menu? (2000) Multi-Row Tables from a search. (1997) Two prices in shoppingcart? (1997) Counting LineItems (2000) Comments in db? (1997) Emailer setup (1997) Initiating NewCart (1997) Shipping costs question (2002) SetHeader not Working (2006) Web DNA... (2007) WebCat2b12plugin - [search] is broken ... not! (1997) multiple search commands (1997) too many nested ... problem (1997) How do I make this faster???? (2000) Emailer (WebCat2) (1997) weening me off overwriting form variables. John Peacock? (2000) Robert Minor duplicate mail (1997) is sku a REQUIRED field on NT (1997)