Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFile Action Upload (.PDF)

Status
Not open for further replies.

pathetic

Programmer
Dec 3, 2004
74
US
I have a form that enables users to upload information to a table in my Access 2002 database. One of the fields is an input box that is filled in by the user browsing their local machine for a .PDF file, selecting it and then upon submit (of the form) all of the data entered into the form fields are uploaded to my database. This form works great, BUT here's what I don't understand.......

User uploads file named FILE.PDF
So why does it appear as C:\CFusionMX\runtime\servers\default\SERVER-INF\temp\???

This is important for me to understand and figure out (for many obvious reasons and) because some of the data from this table is pulled into a CFGrid, and I want the CFGrid to show the short file name, not the c:\cfusion\runtime\etc etc etc

AND this file name in CFGrid is also going to be a hyperlink to the .PDF (which I don't know how to do yet, and you can be assured I'll visit here more for guidance on that....)

I will also pose this question on the Access forum, but I really think there's something I need to do with my CFMX form/action page to make this happen.

Be gentle, I'm a beginner, and I thank you.
 
Cold fusion uploads files to a temp directory and then moves from there... I suppose that's for the overwrite/rename decision making.

Anyway... You can detect what the filename should have been and rename it (this value is in #cffile.clientfile#).

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I see, please tell me more about
"You can detect what the filename should have been and rename it (this value is in #cffile.clientfile#)"

that is, where and how.

I'm trying to learn....
 
Thank you.

the article ( appears to have been written with the assumption that i would know what the file names are.

I don't have any idea what the file names will be, all I know is that they will be .PDF's. Can you suggest what might be my next approach?

From my Form Page:

<!--- Browse for File --->
Locate your PDF File:
<input name="PDF" type="File" id="PDF" />
<P></P>
<!--- Upload file --->
<p>
<input name="" type="submit" value="Upload" />
<br>
</CFFORM>

From my Action Page:
<CFFILE ACTION="upload" destination="C:\CFusionMX\ filefield="PDF" accept="application/pdf" nameconflict="makeunique">

Thank you
 
Look under the paramaters section of that article (second blue table). It lists all of the paramater of the recently uploaded file that you have access to after upload.
clientFile
Name of the file uploaded from the client's system
...
serverFile
Filename of the file saved on the server
This will go back to what webmigit told you earlier:
You can detect what the filename should have been and rename it (this value is in #cffile.clientfile#).
You can reference the name of the file by calling #cffile.clientfile#



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
Right and I'm pretty sure that clientfile is just the filename... I don't think it has a directory path in it...

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top