CF9 Multi File Upload Widget

This new CF9 Multi File Upload widget looks great but it appears it is built using the old CFFILE code rather than that found in the new fileOpen, fileRead etc. functions - the difference being that the latter doesn't load the entire document in memory before writing which avoids several problems.
Am I correct in that this new widget is built on CFFILE 'technology'?
Thanks!
Shane

No - they do not work the same.  Unfortunately, there is no fileUpload.
I cannot find a single example of how to use the new functions to perform a file upload.  This is the code I have come up with and it works fine - except the doc gets saved with the temp name instead of the 'real' name.
<!--- get file name --->
<cfset originalFileName = GetFileFromPath(FORM.sFile)>
<!--- upload file --->
<!--- instantiate object --->
<cfset fileOb = fileOpen(FORM.sFile, "read")>
<!--- move file from temp directory to final folder --->
<cfset destinationfile = "c:\fileUploads\test\#originalFileName#">
<cfif FileExists(destinationfile)>
     <cfoutput>A copy of #destinationfile# already exists.</cfoutput>
<cfelse>
     <cfscript>
       FileCopy(originalFileName, destinationfile);
       </cfscript>
       <cfoutput>Copied: #originalFileName# <BR>
       To: #destinationfile#</cfoutput><BR>
</cfif>
<!--- close object --->
<cfset fileClose(fileOb)>
<cfset info = getFileInfo("c:\fileUploads\test\#originalFileName#")>
I'm looking into using JS to set a hidden form value with the original name (file upload object defaultValue) but I'm still not particulary proficient at JS and I doubt it is necessary - I must be doing something wrong with these new CF8 file functions.

Similar Messages

  • Problem with Multi File upload example, help needed

    I got the code from the following location.....
    http://www.adobe.com/devnet/coldfusion/articles/multifile_upload.html
    And I've got it to work to some degree except I cant get the file transfer to work when pressing, Upload.   Below is what my debugger outputs.  Any thoughts on how to fix this or even what it means?
    At the very bottom of this message is the upload.cfm code.......
    Thanks in advance for the help
    <html>
    <head>
      <title>Products - Error</title>
    </head>
    <body>
    <h2>Sorry</h2>
    <p>An error occurred when you requested this page.
    Please email the Webmaster to report this error.
    We will work to correct the problem and apologize
    for the inconvenience.</p>
    <table border=1>
    <tr><td><b>Error Information</b> <br>
      Date and time: 12/07/09 22:25:51 <br>
      Page:  <br>
      Remote Address: 67.170.79.241 <br>
      HTTP Referer: <br>
      Details: ColdFusion cannot determine how to process the tag &lt;CFDOCUMENT&gt;. The tag name may be misspelled.<p>If you are using tags whose names begin with CF but are not ColdFusion tags you should contact Allaire Support. <p>The error occurred while processing an element with a general identifier of (CFDOCUMENT), occupying document position (41:4) to (41:70).<p>The specific sequence of files included or processed is:<code><br><strong>D:\hshome\edejham7\edeweb.com\MultiFileUpload\upload.cfm      </strong></code><br>
      <br>
    </td></tr></table>
    </body>
    </html>
    <!---
    Flex Multi-File Upload Server Side File Handler
    This file is where the upload action from the Flex Multi-File Upload UI points.
    This is the handler the server side half of the upload process.
    --->
    <cftry>
    <!---
    Because flash uploads all files with a binary mime type ("application/ocet-stream") we cannot set cffile to accept specfic mime types.
    The workaround is to check the file type after it arrives on the server and if it is non desireable delete it.
    --->
        <cffile action="upload"
                filefield="filedata"
                destination="#ExpandPath('\')#MultiFileUpload\uploadedfiles\"
                nameconflict="makeunique"
                accept="application/octet-stream"/>
            <!--- Begin checking the file extension of uploaded files --->
            <cfset acceptedFileExtensions = "jpg,jpeg,gif,png,pdf,flv,txt,doc,rtf"/>
            <cfset filecheck = listFindNoCase(acceptedFileExtensions,File.ServerFileExt)/>
    <!---
    If the variable filecheck equals false delete the uploaded file immediatley as it does not match the desired file types
    --->
            <cfif filecheck eq false>
                <cffile action="delete" file="#ExpandPath('\')#MultiFileUpload\uploadedfiles\#File.ServerFile#"/>
            </cfif>
    <!---
    Should any error occur output a pdf with all the details.
    It is difficult to debug an error from this file because no debug information is
    diplayed on page as its called from within the Flash UI.  If your files are not uploading check
    to see if an errordebug.pdf has been generated.
    --->
            <cfcatch type="any">
                <cfdocument format="PDF" overwrite="yes" filename="errordebug.pdf">
                    <cfdump var="#cfcatch#"/>
                </cfdocument>
            </cfcatch>
    </cftry>

    Just 2 things in my test:
    1) I use no accept attribute. Coldfusion is then free to upload any extenstion.
    Restricting the type to application/octet-stream may generate errors. Also, it is unnecessary, because we perform a type check anyway.
    2) I have used #ExpandPath('.')#\ in place of #ExpandPath('\')#
    <cfif isdefined("form.filedata")>
    <cftry>
    <cffile action="upload"
                filefield="filedata"
                destination="#expandPath('.')#\MultiFileUpload\uploadedfiles\"
                nameconflict="makeunique">
            <!--- Begin checking the file extension of uploaded files --->
            <cfset acceptedFileExtensions = "jpg,jpeg,gif,png,pdf,flv,txt,doc,rtf"/>
            <cfset filecheck = listFindNoCase(acceptedFileExtensions,File.ServerFileExt)/>
    <!---
    If the variable filecheck equals false delete the uploaded file immediatley as it does not match the desired file types
    --->
            <cfif filecheck eq false>
                <cffile action="delete" file="#ExpandPath('.')#\MultiFileUpload\uploadedfiles\#File.ServerFile#"/>
                <cfoutput>Uploaded file deleted -- unacceptable extension (#ucase(File.ServerFileExt)#)</cfoutput>.<br>
            </cfif>
    Upload process done!
            <cfcatch type="any">
                There was an error!
                <cfdocument format="PDF" overwrite="yes" filename="errordebug.pdf">
                    <cfdump var="#cfcatch#"/>
                </cfdocument>
            </cfcatch>
    </cftry>
    <cfelse>
    <form method="post" action=<cfoutput>#cgi.script_name#</cfoutput>
            name="uploadForm" enctype="multipart/form-data">
            <input name="filedata" type="file">
            <br>
            <input name="submit" type="submit" value="Upload File">
        </form>
    </cfif>

  • Plugin for multi file upload in mod_plsql

    Hi,
    Is there any working plugin which allows multi-file upload in mod_plsql for apex 4.2
    Thanks,

    That plug-in jariolamentioned supports IE6 and higher, I used this at a client who works with IE8, so it will work with IE9 to.
    Check the site for more information about browser support:
    APEX Plugin - Multiple File Upload

  • Multi File upload

    I want to develop a functionallity for MultiFile Upload, is it directly supported in JSF 2.2 or i have to use some other implementation of JSF such as RichFaces or ICEFaces.

    Hello,
    Why don't you just make a portal form for them ?
    Making a portal form based on the table (the one holding the BLOBs)
    will generate multi files upload automatically
    Is this what u need ?

  • Multi file upload question

    I have an app that uploads files, and does batch uploads, but
    does it by using the FileReference.upload, and that makes it so
    that it only uploads one file, calls the upload.php script, and
    then uploads another and calls the upload.php script again.
    I would like to be able to upload all of the files, then go
    through the lot of them all at once using foreach($_FILES as
    $tagname=>$object) so that I when it hits the end it can send
    one email out instead of one for each file.
    Does anyone know how to make it loop through the upload a
    bunch of time before triggering the upload.php script?

    Not being familiar with the function you describe, all I can
    say is if you have a loop: while() {
    upload file;
    send email:
    wouldn't you want to change it so the email is sent after the
    loop ends?

  • Multi File Upload with BSP

    Hi,
    i have a question: is it possible to create an open file dialog, which has the functionality, that an user can check/select more than one element (file) in BSP ?
    I hope you can help me.
    Best Regards Patricia Wolf
    Edited by: Patricia Wolf on Aug 23, 2011 3:55 PM

    Hi,
    thank you for your answer, but
    where can i find gbsp_utils and the gos_atchment.htm. I browsed through the repository infosystem- but i dont find anything.
    can you give an advice, please.
    Kind Regards Patricia

  • Multiple file upload not working in IE10 and IE11

    Hi,
    As per the UI5 documentation( https://sapui5.hana.ondemand.com/sdk/#test-resources/sap/ui/commons/demokit/FileUploader.html) , UI5 supports multiple file uploading for IE10 and IE11. I set the "multiple: true" flag in the fileuploader example page and the file browser dialog is not allowing to select multiple files. Does UI5 provide multi file upload support for IE10 and IE11 or am i missing anything ?
    regards
    Raja

    Huh?
    Your problem makes no sense. The filename is included with the upload so that the server knows what the file was originally called. Are you running the JSP locally and reading the file directly off the hard drive??
    I note also that you aren't using a multipart form, which is required to upload a file.
    <form action="uploadFile.jsp" method="post" enctype="multipart/form-data">
      <input type="file" name="upload" value="<%= fileName %>" />
    </form>You'll need to use the Jakarta Commons FileUpload class to correctly process a form encoded with "multipart/form-data" or getParameter("xxx") will return null. You can also use the older com.oreilly.servlet.MultipartForm or whatever it's called. I'm pretty certain that the Jakarta Commons obsoletes all the COS classes.
    Brian

  • Anyone need a File Upload Manager?

    Little sample multi-file upload manager I had to write for a
    recent project.
    It's written in AS2, but I thought it could be useful for
    some people so I
    threw it up on a page, along with the source. Everything you
    need should be
    there - if anyone has any comments, suggestions, etc - reply
    here as I don't
    have a real blog set up right now so there's no comments
    section on the
    page... I should just do that...
    anyway, here ya go:
    http://www.blurredistinction.com/test/upload/manager.htm
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

    Looks good Dave, thanks for sharing... I'll definitely take a
    look at it when I get a chance.
    Re the blog: At least you've got a website. I'm just about
    done getting mine ready. Hopefully I'll be able to share some stuff
    too.

  • File sender, uploader widget

    Is there any file sender, uploader widget for Muse?

    Hi
    Please refer to this thread :
    https://forums.adobe.com/message/6316862
    Thanks,
    Sanjit

  • Is it possible to have a 'file upload' option on an Adobe Muse Form. Is there a widget for this?

    Is it possible to have a 'file upload' option on an Adobe Muse Form. Is there a widget for this?

    Hi
    Please refer to this thread, Upload file button

  • How to upload multi files in struts

    Hi all,
    plz show me how to upload multi files in struts ... :(
    thank in advance.
    bowlkhin

    [help link 1|http://www.roseindia.net/struts/strutsfileuploadandsave.shtml]
    [help link 2|http://www.roseindia.net/struts/strutsfileupload.shtml]

  • Can't upload multi file in ovi share

    Hello, why I can't find the button to upload multi file in ovi share now?  Help me, please!

    Today i had the same problem, i've tried Firefox, Explorer and Chrome without solution.
    At the moment, the only way is to use Nokia Ovi Suite.

  • Change upload file name with com.oreilly.servlet.MultipartRequest to handle the file upload

    1. when use com.oreilly.servlet.MultipartRequest to handle the file upload, can I change the upload file name .
    2. how com.oreilly.servlet.MultipartReques handle file upload? do it change to byte ?
    what  different?  if I use the following method?
       File uploadedFile = (File) mp.getFile("filename");
                   FileOutputStream fos = new FileOutputStream(filename);
                    byte[] uploadedFileBuf = new byte[(int) uploadedFile.length()];
                   fos.write(data);
                 fos.close();

    My questions are
    1) when use oreilly package to do file upload , it looks like i line of code is enough to store the upload file in the
    file direction.
    MultipartRequest multi =
            new MultipartRequest(request, dirName, 10*1024*1024); // 10MB
    why some example still use FileOutputStream?
    outs = new FileOutputStream(UPLOADDIR+fileName); 
        filePart.writeTo(outs); 
       outs.flush(); 
      outs.close();
    2) can I rename the file name when I use oreilly package?

  • File upload to web server

    I need a little help with the file upload process in flex..
    I am trying to upload a file.. i had it where i would get a cgi-script url passing as the following
    filename="filename"&filedata="data of the file"
    then my cgi script "written in C" would read from standard in.. and write the info to a file...
    now i get the following..
    ------------KM7Ef1gL6Ij5cH2ae0ei4Ij5GI3Ef1
    Content-Disposition: form-data; name="Filename"
    Botanical Garden 239.JPG
    ------------KM7Ef1gL6Ij5cH2ae0ei4Ij5GI3Ef1
    Content-Disposition: form-data; name="Filedata"; filename="Botanical Garden 239.JPG"
    Content-Type: application/octet-stream
    in the file i am trying to write.... Can anyone help me fix this problem? I am clueless at this point on what to do..
    sample code below is what i got from trying to work this...
    Thanks in advanced for anyones help..
    <code>  
    const FILE_UPLOAD_URL:String = "http://172.16.1.6:1111/cgi-bin/login.cgi"; 
    private function init():void {fileRef =
    new FileReference();fileRef.addEventListener(Event.SELECT, fileRef_select);
    fileRef.addEventListener(ProgressEvent.PROGRESS, fileRef_progress);
    fileRef.addEventListener(Event.COMPLETE, fileRef_complete);
    private function browseAndUpload():void {fileRef.browse();
    message.text =
    private function fileRef_select(evt:Event):void { 
    try {message.text =
    "size (bytes): " + numberFormatter.format(fileRef.size);fileRef.upload(
    new URLRequest(FILE_UPLOAD_URL) ); 
    trace("going to print file data in a sec... ready?"); 
    trace(fileRef.data); 
    trace(fileRef.name );}
    catch (err:Error) {message.text =
    "ERROR: zero-byte file";}
    private function fileRef_progress(evt:ProgressEvent):void {progressBar.visible =
    true;}
    private function fileRef_complete(evt:Event):void {message.text +=
    " (complete)";progressBar.visible =
    false;}
    </code>

    Here are some code....
    Forms
    <%@ page language="java" session="true" %>
    <html>
    <head>
    <script>
    </script>
    </head>
    <body>
    <form name="myform" method="post" action="fileproc.jsp" enctype="multipart/form-data">
    <input type="file" name="myfile">
    <input type="submit" value="submit">
    </form>
    </body>
    </html>Process
    <%@ page language="java" session="true" import="com.oreilly.servlet.*"%>
    <html>
    <head>
    </head>
    <body>
    <% String s = request.getParameter("myfile"); %>
    <%=s%>
    <br>
    <%
       MultipartRequest multi = new MultipartRequest(request, "C:/multipart/", 10*1024*1024); // 10MB
       Enumeration params = multi.getParameterNames();
       while (params.hasMoreElements()) {
         String name = (String)params.nextElement();
         String value = multi.getParameter(name);
         out.println(name + " = " + value);
       out.println();
       Enumeration e = multi.getFileNames();
       while(e.hasMoreElements()){
           String fname = (String)e.nextElement();
           out.println("<h1>"+fname+"</h1>");
           File fl = multi.getFile(fname);
           FileReader fr = new FileReader(fl);
           BufferedReader buf = new BufferedReader(fr);
           while(buf.ready()){
               out.println(buf.readLine());
           out.println();
           buf.close();
           fl.delete();
    %>
    </body>
    </html>Hope this helps....

  • Emulating HTTP POST for file upload with J2ME

    I have search through a lot of site and couldn't find the actual code. I try to emulate below html with J2ME.
    <form method="POST" enctype="multipart/form-data" action="Insert.asp">
    <td>File :</td><td>
    <input type="file" name="file" size="40"></td></tr>
    <td> </td><td>
    <input type="submit" value="Submit"></td></tr>
    </form>
    here is my code :
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    byte[] filecontent = file byte content ...
    try {
    c = (HttpConnection)Connector.open("http://xx.com/insert.asp");
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("Content-Length", String.valueOf(cmg.length + 15));
    c.setRequestProperty("Content-type","multipart/form-data");
    os = c.openOutputStream();
    os.write("file=c:\\abc.png".getBytes());
    os.write(filecontent);
    os.flush();
    I can emulate form with text field and it work, but when it come to file upload, above code not working, I don't know what to put for the outputstream, filename ? content ? or both ? since the html only has one field that is the "file" field. The file is actually store in rms with filename abc.png, and I just put in the c:\ for the server as a dump path.

    File upload is more complicated then that... you need multi-part MIME formatting.... But I have just the code...
    http://forum.java.sun.com/thread.jspa?forumID=256&threadID=451245

Maybe you are looking for

  • Error message in adobe reader

    Hi everyone, I configured the online interactive forms web dynpro scenario on NW04s SP 10 with ADS SP 10 and Adobe Reader 7.0.8. When I start my application in the portal, the following error message occurs in Adobe Reader: 'This document contained c

  • Error in Flex at the time of Value Help

    Dear All, While I am creating Value Help then this error shows if deployed. "Error in compiling swf for Flex 2 application. Consult log file for details." What should I do? Regards, Santanu

  • I have 60+ checkboxes all with unique names, how can I get a count of how many are checked?

    The checkboxes are named 1a, 1b, 1c, 2a, 2b, 2c, etc.. up to 27a, 27b... I could add the word "bed" to the beginning of each name if it helps. I want to create a text field that will update the count every time a box is checked or unchecked. Thanks

  • Backend tables information in Agile PLM 8.5 and 9.3 versions

    I am upgrading Agile PLM version 8.5 that currently has Oracle database 9g, to version 9.3 application and backend Oracle database to 11g. I need to verify the data between Agile database and our EBS database and am wondering if anyone can give me in

  • Queue size

    I am supposed to write a program in java where a single queue is shared by multiple java programs. I tried create a queue in super class and let sub classes access and update it.But when I run the program and check the size of queue in the sub classe