4 Replies Latest reply on Aug 1, 2006 8:34 AM by Abinidi

    Upload with CFFILE and size limit

    leesiulung
      I'm currentlyuploading files with cffile tag, but need to limit the size of the file. Prefferably before I upload the file. If the user has a really high time out time they can upload some really large files.

      If this is not possible, is there an easier way to limit file size than to use cffile to access the file after it is uploaded and then having to delete it.

      Also, is it me or Adobe's forum increadibly slow... in fact so slow that I can remotely access my computer with a GUI interface faster!!! This is painfull!!!
        • 1. Re: Upload with CFFILE and size limit
          Fernis Level 3
          No, No, No, and No. Can't be done, no other way, No.

          ...that is, using classic technologies like pure HTML, Javascript, CFML, etc.

          Commercial solutions exist, though. One of my favourites is Flash 8's support for file uploads. Google the web, and you'll be sure to find examples of Flash clients which can push files to a CF server.
          • 2. Re: Upload with CFFILE and size limit
            leesiulung Level 1
            bummer. I can't stand flash...

            So I guess the only way is allow them to upload the file and then delete it if it is to large of a size. I can't believe nobody found a good solution to this...

            And the again, the Adobe forum is painfully slow. I appreciate the extra resource, but geezzz... what did they do to this site.
            • 3. Re: Upload with CFFILE and size limit
              Level 7
              Well the basic problem is that this is built into the stateless nature
              of the HTTP/HTML standards. If you want this you need to use something
              that does not use these standards, such as Flash/Flex.



              leesiulung wrote:
              > bummer. I can't stand flash...
              >
              > So I guess the only way is allow them to upload the file and then delete it if
              > it is to large of a size. I can't believe nobody found a good solution to
              > this...
              >
              > And the again, the Adobe forum is painfully slow. I appreciate the extra
              > resource, but geezzz... what did they do to this site.
              >
              • 4. Re: Upload with CFFILE and size limit
                Abinidi Level 1
                Ian is right. It doesnt matter what language you use, you are still limited to what http standards allow and do.

                One thing you could try using is see what the cgi.content_length is of the file. It will check to see the size of the content header being passed to the page or code that doing your file upload.
                YET this is not the most accurate or reliable way to check file size, AND it will only really work if you are uploading one file at a time. If you do multiple files, it will add them all up in one lump sum and you wont be able to tell individual file sizes.

                Flash 8 is one of the better ways to do it client side, which is what you would be trying to acheive. ASFUSION has some great tutorials and working downloadable examples on doing Flash file uploads, and I believe that they check for file size and type prior to uploading

                http://www.asfusion.com/examples/item/file-upload-with-coldfusion-flash-forms