file upload - preventing double or more full stops in file name
Hi, I would like to retrieve the original path of the file upload for the purposes of grabbing the initial file name and then checking to see how many full stops (.) are in the original file. I need this to happen before I process it via CFFILE. Right now the form data posts back in a cfdump var=#form.b_original_form_filefield# as: C:\JRun4\servers\cfusion25\SERVER-INF\temp\cfusion.war-tmp\neotmp4910092545170934955.tmp which is sort of useless for my needs. Is there a workaround? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342810 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: file upload - preventing double or more full stops in file name
I would like to retrieve the original path of the file upload for the purposes of grabbing the initial file name and then checking to see how many full stops (.) are in the original file. I need this to happen before I process it via CFFILE. Right now the form data posts back in a cfdump var=#form.b_original_form_filefield# as: C:\JRun4\servers\cfusion25\SERVER-INF\temp\cfusion.war-tmp\neotmp4910092545170934955.tmp which is sort of useless for my needs. Is there a workaround? Why do you need to do this before you process it with CFFILE? All that happens when you use CFFILE ACTION=UPLOAD is that CF writes the file to a specified location on the filesystem. The file has already been received by the web server, and stored in a temporary file location. So, write the file to the filesystem in one place, then move it somewhere else with a subsequent CFFILE if you really want to. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342811 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: file upload - preventing double or more full stops in file name
Why do you need to do this before you process it with CFFILE? Because once its uploaded the server hacks off the last (.) For example: original file: somefile.mack.txt renamed file on server: somefile.mack I would like to retrieve the original path of the file upload for the purposes of grabbing the initial file name and then checking to see how many full stops (.) are in the original file. I need this to happen before I process it via CFFILE. Right now the form data posts back in a cfdump var=#form. b_original_form_filefield# as: C:\JRun4\servers\cfusion25\SERVER-INF\temp\cfusion. war-tmp\neotmp4910092545170934955.tmp which is sort of useless for my needs. Is there a workaround? Why do you need to do this before you process it with CFFILE? All that happens when you use CFFILE ACTION=UPLOAD is that CF writes the file to a specified location on the filesystem. The file has already been received by the web server, and stored in a temporary file location. So, write the file to the filesystem in one place, then move it somewhere else with a subsequent CFFILE if you really want to. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342812 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: file upload - preventing double or more full stops in file name
Why do you need to do this before you process it with CFFILE? Because once its uploaded the server hacks off the last (.) For example: original file: somefile.mack.txt renamed file on server: somefile.mack By the time your server-side script runs, the file has already been uploaded. The CFFILE tag just processes the already-uploaded file. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342814 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Re: file upload - preventing double or more full stops in file name
Please have a look at this post: http://www.williamoncoldfusion.com/index.php/knowledgebase/file-uploading If you are referring to the cffile.serverfilename key that is available after the cffile upload command, that brings back somefile.mack, the extension is in a different key off of cffile of serverfileext. checkout this page as well: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_f_10.html -- William E. Seiter On Mar 7, 2011, Don danfar...@hotmail.com wrote: Why do you need to do this before you process it with CFFILE? Because once its uploaded the server hacks off the last (.) For example: original file: somefile.mack.txt renamed file on server: somefile.mack I would like to retrieve the original path of the file upload for the purposes of grabbing the initial file name and then checking to see how many full stops (.) are in the original file. I need this to happen before I process it via CFFILE. Right now the form data posts back in a cfdump var=#form. b_original_form_filefield# as: C:\JRun4\servers\cfusion25\SERVER-INF\temp\cfusion. war-tmp\neotmp4910092545170934955.tmp which is sort of useless for my needs. Is there a workaround? Why do you need to do this before you process it with CFFILE? All that happens when you use CFFILE ACTION=UPLOAD is that CF writes the file to a specified location on the filesystem. The file has already been received by the web server, and stored in a temporary file location. So, write the file to the filesystem in one place, then move it somewhere else with a subsequent CFFILE if you really want to. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342815 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: file upload - preventing double or more full stops in file name
On 3/7/2011 11:40 AM, Don wrote: Why do you need to do this before you process it with CFFILE? Because once its uploaded the server hacks off the last (.) For example: original file: somefile.mack.txt renamed file on server: somefile.mack Well, as Dave indicated, ColdFusion is not actually involved in the file upload. No matter that the parameter of the cffile... tag is called. The flow is: User picks file with client (i.e. browser) file form control. The user submits the request. The client reads the file from the user's file system and encrypts it into the header of the request. It then sends the request to the web server (i.e. IIS, Apache, etc). The web server decrypts the file from the header to a temporary location. (C:\JRun4\servers\cfusion25\SERVER-INF\temp\cfusion.war-tmp\neotmp4910092545170934955.tmp) for example. The web server then tells ColdFusion about the uploaded file and where it was. If you want to do anything with the file data before the last step, you will either have to have code running on the Client system OR you might be able to get some of the data from the raw request headers. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342817 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: file upload - preventing double or more full stops in file name
Thanks guys. IAN this caught my attention: The client reads the file from the user's file system and encrypts it into the header of the request I've been using fiddler to view the headers and see the data I want : 200 Content-Disposition: form-data; name=b_file; filename=C:\Documents and Settings\dsdfsd\Desktop\clean up\test.docupload.doc However I don't know how to access this via coldfusion. I've tried gethttprequestData but unfortunatley I think by that point my window of opportunity had past. somehow need to get at the request at an earlier stage. On 3/7/2011 11:40 AM, Don wrote: Why do you need to do this before you process it with CFFILE? Because once its uploaded the server hacks off the last (.) For example: original file: somefile.mack.txt renamed file on server: somefile.mack Well, as Dave indicated, ColdFusion is not actually involved in the file upload. No matter that the parameter of the cffile... tag is called. The flow is: User picks file with client (i.e. browser) file form control. The user submits the request. The client reads the file from the user's file system and encrypts it into the header of the request. It then sends the request to the web server (i.e. IIS, Apache, etc). The web server decrypts the file from the header to a temporary location. (C:\JRun4\servers\cfusion25\SERVER-INF\temp\cfusion. war-tmp\neotmp4910092545170934955.tmp) for example. The web server then tells ColdFusion about the uploaded file and where it was. If you want to do anything with the file data before the last step, you will either have to have code running on the Client system OR you might be able to get some of the data from the raw request headers. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342819 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: file upload - preventing double or more full stops in file name
William, Ah I get you. since the extension will be cut off and placed within another variable all I would have to do post file upload is search the server.filename for a(.). Easy. Cheers. Please have a look at this post: http://www.williamoncoldfusion. com/index.php/knowledgebase/file-uploading If you are referring to the cffile.serverfilename key that is available after the cffile upload command, that brings back somefile. mack, the extension is in a different key off of cffile of serverfileext. checkout this page as well: http://livedocs.adobe. com/coldfusion/8/htmldocs/help.html?content=Tags_f_10.html -- William E. Seiter On Mar 7, 2011, Don danfar...@hotmail.com wrote: Why do you need to do this before you process it with CFFILE? Because once its uploaded the server hacks off the last (.) For example: original file: somefile.mack.txt renamed file on server: somefile.mack I would like to retrieve the original path of the file upload for the purposes of grabbing the initial file name and then checking to see how many full stops (.) are in the original file. I need this to happen before I process it via CFFILE. Right now the form data posts back in a cfdump var=#form. b_original_form_filefield# as: C:\JRun4\servers\cfusion25\SERVER-INF\temp\cfusion. war-tmp\neotmp4910092545170934955.tmp which is sort of useless for my needs. Is there a workaround? Why do you need to do this before you process it with CFFILE? All that happens when you use CFFILE ACTION=UPLOAD is that CF writes the file to a specified location on the filesystem. The file has already been received by the web server, and stored in a temporary file location. So, write the file to the filesystem in one place, then move it somewhere else with a subsequent CFFILE if you really want to. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342820 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: file upload - preventing double or more full stops in file name
On 3/7/2011 12:52 PM, Don wrote: 200 Content-Disposition: form-data; name=b_file; filename=C:\Documents and Settings\dsdfsd\Desktop\clean up\test.docupload.doc And that is different from the cffile.clientFile property? Do note that cffile.clientFile is the full file name, cffile.clientFileName is the file name with the extension (i.e. the part after the list 'full stop' as you call it) stripped off. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342821 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm