File uploads without saving file

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default File uploads without saving file

    I am running a system that takes a users file and uploads it to a blob. That
    worked flawlessly in Coldfusion 6.1 and 7. Now, I need to get the mime type.
    Thats not so easy. The only answers Ive found so far is to save a temp file,
    cffile it and get it that way, but there must be a cleaner way. So I went back
    to my java way of doing things, and tried to bring it in.

    Here is what Im doing

    I get the file
    <CFFILE ACTION="ReadBinary"
    FILE="#thefile#"
    VARIABLE="aBinaryObj">

    create an object
    <CFOBJECT type="java" name="parser"
    class="com.oreilly.servlet.multipart.MultipartPars er" action="create">

    everything is working good until
    <CFSET thenum=10485760>
    <CFSET parse = parser.init(GetPageContext().getRequest(),thenum) >

    I get

    Object Instantiation Exception.
    An exception occurred when instantiating a java object. The cause of this
    exception was that: .

    I have been at this all day, with no luck. If I put in 10*1024*1024, it will
    fail because cf will convert it to a double, while MultipartParser wants an
    int. If I try and create a CFX tag to do, the CFX extention request is not
    compatiable with the MultipartParser. Anyone got any ideas? Im running low...

    staticthis Guest

  2. Similar Questions and Discussions

    1. Web File uploads
      While trying to do a simple file upload via a web form, (enctype="multipart/form-data"), I've run into a problem that has me stymied. This is an...
    2. Specify temp directory and file name for file uploads?
      I'm interested in understanding how MX processes file uploads. 1) By default, uploaded files seem to be placed in the...
    3. File Uploads
      Hello You must use <form action="uploadItem.php" method="post" enctype="multipart/form-data"> gerwazy POLAND
    4. PHP and file uploads
      Hi All, Here's one thing that I don't know much about - file uploading. As part of my project, I will have to build a file manager of sorts -...
    5. #24919 [NEW]: PHP File Uploads in RAM
      From: jgiglio at smythco dot com Operating system: Linux PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug...
  3. #2

    Default Re: File uploads without saving file

    look into the javacast() function... if worse comes to worst you can write your
    own java class that can be called from CF.... no need to use the CFX interface.
    Drop the cfobject tag though... just personal opinion but it's ugly. I like
    the <cfset parser =
    createObject('java','com.oreilly.servlet.multipart .MultipartParser').init()/>
    syntax much better.

    Dross.2 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139