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:

firewall ports for Mac OS X/WebCatalog (2001) AOL (1999) unitshipcost vs shipcosts (1997) Using Applescript to process WebCatalog functions (1998) Time/date formatting %X doesn't work ... (1997) Shopping Cart Problem (1998) Getting Dreamweaver MX ( DW MX ) to play nicely with .TPL files (2003) Works! (1997) Search Engine questions ... (2002) OT-Load balance (2004) setting taxable to true (1997) Attn: Scott / Le - webdna 6.0a patch and mysql (2005) PCS Frames (1997) WebCat on Intel Core 2 macs anyone? (2007) random in arizona (2003) Cart problem (1999) Big Databases (1997) auto adding SKUs w/DB helper (1998) Re:no [search] with NT (1997) Max Record length restated as maybe bug (1997)