0
New Here
,
/t5/coldfusion-discussions/need-the-path-to-upload-file/td-p/882562
May 20, 2008
May 20, 2008
Copy link to clipboard
Copied
I have a non CF form with an input element type of file. The
form passes and uploads the file correctly, however the path when
<cfoutput> is a temp path. not the actually path from the
users machine. I need the actually file name to store in the
database. form.doc1 is not the actually path. Thanks.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
LEGEND
,
May 20, 2008
May 20, 2008
contrary to what Ian says, you CAN get the user's path to
file with a
bit of javascript... but WHY? why do you need that path? it has no
relevance to YOUR server paths. it is of no use to you.
if all you need is the NAME of uploaded file, then CFFILE.SERVERFILE is
your friend. CFFILE action="upload" returns a nice structure with lots
of useful data - look it up in the docs.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
bit of javascript... but WHY? why do you need that path? it has no
relevance to YOUR server paths. it is of no use to you.
if all you need is the NAME of uploaded file, then CFFILE.SERVERFILE is
your friend. CFFILE action="upload" returns a nice structure with lots
of useful data - look it up in the docs.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
LEGEND
,
/t5/coldfusion-discussions/need-the-path-to-upload-file/m-p/882563#M81207
May 20, 2008
May 20, 2008
Copy link to clipboard
Copied
headjava wrote:
> I need the actually file name to
> store in the database. form.doc1 is not the actually path. Thanks.
>
Why?
I'm not going to give that path to you?
Here, I'll fake a path for you?
In other words. Nope you can NOT get the path from the client machine
where a file was uploaded from. The browser does not send it, the web
server does not receive it and ColdFusion does not want it. This would
be a huge security hole if such a thing was allowed, and the smart
people who amended the http protocol to upload files said NO WAY.
IF you are in such an environment where users can be required to
download software to circumvent such precautions there are supposedly
active-X controls that can provide a more direct connection between
client and server and provide this type of invasive data.
But other then that, you are out of luck here.
> I need the actually file name to
> store in the database. form.doc1 is not the actually path. Thanks.
>
Why?
I'm not going to give that path to you?
Here, I'll fake a path for you?
In other words. Nope you can NOT get the path from the client machine
where a file was uploaded from. The browser does not send it, the web
server does not receive it and ColdFusion does not want it. This would
be a huge security hole if such a thing was allowed, and the smart
people who amended the http protocol to upload files said NO WAY.
IF you are in such an environment where users can be required to
download software to circumvent such precautions there are supposedly
active-X controls that can provide a more direct connection between
client and server and provide this type of invasive data.
But other then that, you are out of luck here.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/need-the-path-to-upload-file/m-p/882564#M81208
May 20, 2008
May 20, 2008
Copy link to clipboard
Copied
contrary to what Ian says, you CAN get the user's path to
file with a
bit of javascript... but WHY? why do you need that path? it has no
relevance to YOUR server paths. it is of no use to you.
if all you need is the NAME of uploaded file, then CFFILE.SERVERFILE is
your friend. CFFILE action="upload" returns a nice structure with lots
of useful data - look it up in the docs.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
bit of javascript... but WHY? why do you need that path? it has no
relevance to YOUR server paths. it is of no use to you.
if all you need is the NAME of uploaded file, then CFFILE.SERVERFILE is
your friend. CFFILE action="upload" returns a nice structure with lots
of useful data - look it up in the docs.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
headjava
AUTHOR
New Here
,
LATEST
/t5/coldfusion-discussions/need-the-path-to-upload-file/m-p/882565#M81209
May 21, 2008
May 21, 2008
Copy link to clipboard
Copied
Thanks for the replies. As I stated, I just need the upload
filename, I wrongly assumed I needed the path to extract the
filename. I developed apps on an IBM web product Net.Data and thats
how I had to do it. CFFILE. is my friend.
Thanks again.
Thanks again.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

