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

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

File Upload

  << 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:
cflists
07/11/2003 05:52 PM

I know I've used something before that could tell you the filesize of a file input when you post a form, but I can't find the code. I remember testing images to not allow upload of images over 100K. Is it a form var or CGI? I know you can see file.filesize after you do a file upload, but I need to avoid uploading the file if it's over a certain size. Help?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Barney Boisvert
07/11/2003 06:02 PM

There is a CGI variable called CONTENT_LENGTH that will hold the length of uploaded file content.  I believe that's the length before the content is unencoded, but I'm not 100% sure about that. Note that the file is uploaded no matter what.  It gets stored as a temp file somewhere on the file system before CF starts processing the request. The CFFILE ACTION="upload" tag only moves the file from the temp location to the location you specifiy. barneyb --- Barney Boisvert, Senior Development Engineer AudienceCentral bboisvert@audiencecentral.com voice : 360.756.8080 x12 fax   : 360.647.5351 www.audiencecentral.com ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
jon hall
07/11/2003 07:48 PM

This will do it...only available as a DW plugin though. I remember just opening up the plugin and hacking out what I was interested in though. http://massimocorner.com/index.html?body$http://massimocorner.com/dw/behaviors.htm It works using the fileSize attribute in IE4+ iirc. <img src="test.gif" onclick="alert(this.fileSize)"> -- jon mailto:jonhall@ozline.net Friday, July 11, 2003, 5:49:13 PM, you wrote: cbn> I know I've used something before that could tell you the filesize of a file input when you post a form, but I can't find the code. I remember testing images to not allow upload of images over cbn> 100K. Is it a form var or CGI? I know you can see file.filesize after you do a file upload, but I need to avoid uploading the file if it's over a certain size. Help?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Massimo Foti (on holiday)
07/12/2003 01:52 AM

"jon hall" <jonhall@ozline.net> wrote in message news:153287107999.20030711194620@ozline.net... > This will do it...only available as a DW plugin though. I remember > just opening up the plugin and hacking out what I was interested in > though. > http://massimocorner.com/index.html?body$http://massimocorner.com/dw/behavio rs.htm > > It works using the fileSize attribute in IE4+ iirc. > <img src="test.gif" onclick="alert(this.fileSize)"> It actually works with Mozilla/NN 6+ as well (the code is more complex than that). Unfortunately if fails silently on the Mac -- ---------------------------- Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ ----------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Peter Tilbrook
07/12/2003 04:33 AM

Just spent the best part of three days attempting to restore my brothers PC to some level of normality. It's a nice machine, AMD Athlon I admit, the real trick is when trying to RESTORE a machine and not do something illegal. A problem here, for example, is that whilst bro is licensed for Windows 98, this particular OS is NOT bootable from CD-ROM on a naked machine, which is what I was aiming for. I can understand Microsoft's concerns about piracy very well but it can be very difficult to get a licensed Win98 machine back up to speed when the floppy drive (remember those) refuse to work at all. I managed to get around this earlier by directly connecting the cables from bro's dead floppy drive to another machine within cable reach where the floppy drive actually still worked. A mere workaround that worked at the time and a legal version of Win98 was restored. Bro was happy. I was not. Not all hardware will like or love the likes of Win2K or even WinXP. In my brothers case when the floppy carked it, it was a major effort to get it to a level to restore from his Win98 disk - as I've since learnt no longer supported by Microsoft (NT4 has joined this rank). My main point is if you have IMPORTANT DATA back it up and do not expect to be able to restore your existing OS (eg: Win98SE) on newer hardware without some major pain. I can understand the MS regime to UPGRADE but I know my bro doesn't want a bar of it. It's geting harder to say "No my brother, you need to upgrade to Windows XP despite how farked it is, your hardware has limitations that may be resolved with XP, but - hey bro - they may not! But bro a bit of extra memory won't hurt much - you will need that for XP. But why not 2000? Ahhh, like to play games, you sinner and father of children. Bro now surrepticiously reguire ME to acquire and fit a memory upgrade of at least 128MB to take him to 256Mb. That is all well and good. All my Bro wants is Windows 98, SE admittedly, back on his machine which he paid an arm and a leg for. Perhaps MS should look at the resellers for OS piracy.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Steven Erat
07/11/2003 05:56 PM

Christian Cantrell posted a solution in his blog back in January: http://www.markme.com/cantrell/archives/002237.cfm HTH I know I've used something before that could tell you the filesize of a file input when you post a form, but I can't find the code. I remember testing images to not allow upload of images over 100K. Is it a form var or CGI? I know you can see file.filesize after you do a file upload, but I need to avoid uploading the file if it's over a certain size. Help?

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
cflists
07/11/2003 06:15 PM

Gracias Barney and Steven. There is a CGI variable called CONTENT_LENGTH that will hold the length of uploaded file content.  I believe that's the length before the content is unencoded, but I'm not 100% sure about that. Note that the file is uploaded no matter what.  It gets stored as a temp file somewhere on the file system before CF starts processing the request. The CFFILE ACTION="upload" tag only moves the file from the temp location to the location you specifiy. barneyb --- Barney Boisvert, Senior Development Engineer AudienceCentral bboisvert@audiencecentral.com voice : 360.756.8080 x12 fax   : 360.647.5351 www.audiencecentral.com ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Peter Tilbrook
07/12/2003 04:36 AM

Product Manager David Deming has left Macromedia; Matt Brown, the excellent DW community manager, just stopped blogging (click here) and left the building, and Macromedia have sacked (click here) some of their Team Macromedia volunteers. Given that there's at least half a million Dreamweaver users out there, you'd think Macromedia would be ploughing money into community management


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

Search cf-talk

September 09, 2010

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