ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 8th, 2011, 10:21 AM
dancook dancook is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 28 dancook User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 12 m 5 sec
Reputation Power: 0
Uploading Large Files

I need to upload large files through a form.

I've increased the post size limit to 200mb, but since you can't check before it attempts to upload if it is above that - it will attempt to upload before it runs out of memory.

Also uploading a file that is <200mb takes a little while, but I see no option of providing feedback to the client about time remaining.

I've been googling solutions for days, tried out a few - but nothing I can work with.

Is there anything which does this well? Is there anyway I can avoid writing to files to memory before the filesystem as ColdFusion does?

Cf7 btw.

Cheers, Dan

Reply With Quote
  #2  
Old September 8th, 2011, 03:57 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
You can check CGI.CONTENT_LENGTH on the server before starting the upload with CFFILE. Not perfect but should give you a good idea of the size of what they are trying to upload.

CF 9 added some additional features to handle file uploads, and I believe it now writes the file directly to disk rather than storing it in memory first.

However, uploading large files is really not something you want a web application to handle (whether it is PHP, CF, Java, etc.). The entire time the file is uploading, it is using a processor thread. So depending on how many people are doing this and how big the files are, you can easily use up your entire thread pool.

There are much more efficient ways to do this, such as: http://commons.apache.org/fileupload/

Hope that helps,

Brian

Reply With Quote
  #3  
Old September 9th, 2011, 04:26 AM
dancook dancook is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 28 dancook User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 12 m 5 sec
Reputation Power: 0
Quote:
Originally Posted by kiteless
You can check CGI.CONTENT_LENGTH on the server before starting the upload with CFFILE. Not perfect but should give you a good idea of the size of what they are trying to upload.

CF 9 added some additional features to handle file uploads, and I believe it now writes the file directly to disk rather than storing it in memory first.

However, uploading large files is really not something you want a web application to handle (whether it is PHP, CF, Java, etc.). The entire time the file is uploading, it is using a processor thread. So depending on how many people are doing this and how big the files are, you can easily use up your entire thread pool.

There are much more efficient ways to do this, such as: http://commons.apache.org/fileupload/

Hope that helps,

Brian


Thanks Brian

The problem with CF7 is that the moment you hit 'submit' the entire file is written to memory (ie. uploaded) before you even use CFFile. CFFile is the 'quick bit' copying it from server memory to a file location. It's not until the file has been uploaded to memory that you can use CGI.CONTENT_LENGTH - and if the file was above the post limit of the CF Server - then you won't even get that far! (outofmemory)

I would love my client to upgrade to CF9 Enterprise - but it's not a quick process

Thankfully not many people are likely to be doing this simultaneously - I suspect only 1 person at a time will ever be uploading.

I'll have a look at the fileupload - but unless I find some simpler integration details it might fall outside of my timeframe

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Uploading Large Files

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap