House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

bizarre cffile upload bug

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony
05/07/2012 09:33 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
LRS Scout
05/07/2012 09:38 PM

Do you have the form attributes right, umm type and method? ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony
05/07/2012 09:57 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
William Seiter
05/07/2012 10:08 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/07/2012 10:11 PM

it's chrome. wow. works just fine in safari. ok, thanks anyway guys! tony ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony
05/07/2012 10:24 PM

here's my chrome info: Version 19.0.1084.41 beta tw ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony
05/07/2012 10:33 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/07/2012 11:57 PM

> 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.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
.jonah
05/08/2012 12:04 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ras Tafari
05/08/2012 08:32 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/07/2012 10:28 PM

----- 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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ras Tafari
05/07/2012 10:32 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/07/2012 11:56 PM

> 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.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ras Tafari
05/08/2012 08:32 AM

:) 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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ras Tafari
05/08/2012 09:42 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/08/2012 10:15 AM

> 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.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ras Tafari
05/08/2012 10:20 AM

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 -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 26, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference