|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
bizarre cffile upload bug
hi there.Tony 05/07/12 09:33 P Do you have the form attributes right, umm type and method?LRS Scout 05/07/12 09:38 P Tony WeegTony 05/07/12 09:57 P Yeah those are right.LRS Scout 05/07/12 10:00 P Is that location inside of the web root? You say the file exists but isn't openable, right? If it is outside of the web root, you may need to add a mapping to the server.William Seiter 05/07/12 10:08 P it's chrome.Tony Weeg 05/07/12 10:11 P here's my chrome info:Tony 05/07/12 10:24 P I must assume that the "beta" tag is maybe what is happening here.Tony 05/07/12 10:33 P > I must assume that the "beta" tag is maybe what is happening here.Dave Watts 05/07/12 11:57 P Can you download the uploaded file via FTP and open it in Chrome?.jonah 05/08/12 12:04 A the file is written as a 103kb file both ways, its ftp'd up, as the same size.Ras Tafari 05/08/12 08:32 A > im sending a file to my server with the following code:Dave Watts 05/07/12 10:28 P bad guess amigo :)Ras Tafari 05/07/12 10:32 P > but seriously, I'm merely hitting a method in my main controller thatDave Watts 05/07/12 11:56 P :) dude. seriously.Ras Tafari 05/08/12 08:32 A so, I made a simple test case :) and it worked in chrome.Ras Tafari 05/08/12 09:42 A > so, I made a simple test case :) and it worked in chrome.Dave Watts 05/08/12 10:15 A well, my dear watt's-son :)Ras Tafari 05/08/12 10:20 A hi there. im sending a file to my server with the following code: <cffile action="upload" destination="d:\webserver\doman.com\www\docs" nameconflict="overwrite" filefield="pdf_file" attributes="readonly" /> the result of this when I browse the file in chrome and safari (on my mac) both result in a "Failed to Load PDF Document" error. _however_ if I simply ftp the file, the same exact file from my machine, and I browse to it, it's working just fine :) *when I use CFFILE, the file actually appears on the server, and i can see the file, with filesize as I would expect it. this doesnt work, I need to build this for my client to manage the files themselves, ive done this 20 other times for other clients, but today, its just not working... any clues?! ive tried every attribute i can think of... nothing is making sense. thanks tw Do you have the form attributes right, umm type and method? ----- Excess quoted text cut - see Original Post for more ----- Tony Weeg Sr. Web Applications Architect & Developer Navtrak, Inc. Smart Companies Drive Navtrak www.navtrakgps.com 800.787.2337 t'is correct... <form method="post" action="#cgi.script_name#" enctype="multipart/form-data"> i believe?! tw ----- Excess quoted text cut - see Original Post for more ----- Yeah those are right. ----- Excess quoted text cut - see Original Post for more ----- Is that location inside of the web root? You say the file exists but isn't openable, right? If it is outside of the web root, you may need to add a mapping to the server. ---------------------- William Seiter On May 7, 2012, at 6:32 PM, Tony <tonyweeg@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- it's chrome. wow. works just fine in safari. ok, thanks anyway guys! tony ----- Excess quoted text cut - see Original Post for more ----- here's my chrome info: Version 19.0.1084.41 beta tw ----- Excess quoted text cut - see Original Post for more ----- I must assume that the "beta" tag is maybe what is happening here. something about the filestream is getting corrupt when sending a file up. weeeeeeeeird. Tony Weeg Sr. Web Applications Architect & Developer Navtrak, Inc. Smart Companies Drive Navtrak www.navtrakgps.com 800.787.2337 ----- Excess quoted text cut - see Original Post for more ----- > I must assume that the "beta" tag is maybe what is happening here. > something about the filestream is getting corrupt when sending a file up. > weeeeeeeeird. Is the file itself written properly to the server in both cases? 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. Can you download the uploaded file via FTP and open it in Chrome? Also is it byte-for-byte the same as the original you uploaded? On 5/7/12 8:57 PM, Dave Watts wrote: ----- Excess quoted text cut - see Original Post for more ----- the file is written as a 103kb file both ways, its ftp'd up, as the same size. cffile through chrome (beta) = no dice cffile through safari = workie workie as i said, gonna test more this am. ----- Excess quoted text cut - see Original Post for more ----- ----- Excess quoted text cut - see Original Post for more ----- My conclusion would be that, since the file upload is in fact working, the problem is being caused by the code after the file upload. Specifically, I'd guess that you're trying to render the PDF you just uploaded. Do you really need to do that in the same operation? 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 bad guess amigo :) but seriously, I'm merely hitting a method in my main controller that does stuff for this site. works in safari 100% of the time!!! just not chrome. weird. <cftry> <cfset request.result = application.admin.addPDF(form.name, cffile.serverfile, dateFormat(now(),'mm/dd/yyyy'), form.publishDate, form.categoryId) /> <cfif request.result> <cflocation url = "index.cfm?step=viewPDFFiles&fileUploaded=#form.name#" /> <cfelse> <cflocation url = "index.cfm?step=viewPDFFiles&fileUploaded=0" /> </cfif> <cfcatch type="any"> <cflocation url = "index.cfm?step=viewPDFFiles&fileUploaded=0" /> </cfcatch> </cftry> ----- Excess quoted text cut - see Original Post for more ----- > but seriously, I'm merely hitting a method in my main controller that > does stuff for this site. > works in safari 100% of the time!!! just not chrome. I'm still going with "something happening after the file upload" for $100, Alex. But to see what exactly this might be, here's what I'd do: 1. Build a working version outside of your controller (separate little app) that just does the file upload (and if you're then showing the file, that too). 2. Test this to make sure it works in Chrome. 3. Use a recording proxy/packet sniffer/Firebug/etc to see what's different in the response between the two. 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. :) dude. seriously. the controller has no play in this, the controller merely does the sql insertion of the record that "yes" a file has been uploaded, here is its name, publish date, etc. this piece is behind the site, in the /admin area. there's no VIEWING of the pdf back there just uploading and saving those facts in the DB. mind you, this exact same code, with ZERO changes, works spot-on in safari. my BETA version of chrome is the issue. im going to do a test with the same code, pared down to the basics, and then ill show ya what happens. this ill make public facing, gimme a few. tw ----- Excess quoted text cut - see Original Post for more ----- so, I made a simple test case :) and it worked in chrome. so, maybe the cflocation (back to the "you've succeeded" page) that is after the cffile tag would make the file not correct, and corrupt?? weird. weird. tw ----- Excess quoted text cut - see Original Post for more ----- > so, I made a simple test case :) and it worked in chrome. http://www.youtube.com/watch?feature=player_detailpage&v=cCI18qAoKq4#t=59s > so, maybe the cflocation (back to the "you've succeeded" page) that is > after the cffile tag would make the file not correct, and corrupt?? > > weird. > > weird. "How often have I said to you that when you have eliminated the impossible, whatever remains, however improbable, must be the truth?" 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. well, my dear watt's-son :) im perplexed, but ill tinker with it later. take'er easy! ----- Excess quoted text cut - see Original Post for more -----
|
May 26, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||