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?

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 ?

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

  • 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

  • File Upload Question

    Hi all,
    We have a requirement to allow users to upload a file, store it, and capture some attributes of the file, specifically the creation date and time of the file.
    I have successfully implemented a messageFileUpload item of dataType CLOB with no issues. Is there any way for me to obtain the date and time of the uploaded file?
    Thank you all in advance!

    As my understanding , Untill And Unless you are not providing this information to System , there is no way to you to obtain the date and time of the uploaded file?

  • 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 Upload PJC questions

    File Upload PJC
    I have installed the File Upload PJC demo & got it working.
    We are using Forms 6i patch 8 with servlet configuration, iAS 1.0.2.2.1 on Win 2000, Oracle 8.173
    We want to upload/download files to the server & save them as BFILES in the database. I think I am on the right track but have some questions:
    What do I have to change in the PJC to increase the memory so I can upload a file > 4 MB? We will be uploading some large files. I'd also like to ability to select multiple files to upload. I don't know much about Java programming but will learn if this is the best way to accomplish this.
    I want to upgrade to Forms patch 12. I understand that it uses Jinitiator 1.3 & that it will popup a dialog when it sees a new signed Jar file & will automatically import the certificate if the user decides to trust it - but I read on the Technet forum there is a bug 2483719 - does this work with patch 12?
    We also want to use the Native JVM for IE (when it will work with XP - is this patch 13?). What do we have to change if we create a signed CAB file?
    We also need the reverse to download a file to the client - WITHOUT using web.show_document - since this does not always prompt you with a save dialog box & tries to open the file in the browser.
    Any ideas will be helpful - thanks.
    [email protected]

    Laura,
    these are many questions in one post and I try to answer it as good as I can
    We want to upload/download files to the server & save them as BFILES in the database. I think I am on the right track but have some questions:
    What do I have to change in the PJC to increase the memory so I can upload a file > 4 MB? We will be uploading some large files.
    As far as I know there is no restriction to the size of the file uploaded to the server. There exist a recommendation of to which size this bean has been tested. Due to the implementation of the Bean there are defined chunk sizes for the data passed, but this does not limit the size of a downloaded file.
    I'd also like to ability to select multiple files to upload. I don't know much about Java programming but will learn if this is the best way to accomplish this.
    Actually you will have to change the code then. First you need to set a porperty on the file dialog allowing the selection of multiple files. Next you will have to handle multiple files in the bean code. Yes, without Java you will not get there.
    want to upgrade to Forms patch 12. I understand that it uses Jinitiator 1.3 & that it will popup a dialog when it sees a new signed Jar file & will automatically import the
    certificate if the user decides to trust it - but I read on the Technet forum there is a bug 2483719 - does this work with patch 12?
    The problem is that you use a different (custom) signature for the upload bean, after modifying it, that requires the user to first grant it permissions. The bug means that this currently cannot be handled with Jinitiator 1.3.x. The work around is explained in a Whitepaper on OTN about signing Java Bean in Forms (Forms9i collateral section). There is no dependency to teh Forms patch you use, but to Jinitiator. So yes, teh work around will work there.
    We also want to use the Native JVM for IE (when it will work with XP - is this patch 13?).
    Possibly. That's the target patch.
    What do we have to change if we create a signed CAB file?
    You'll have to use the Microsoft SDK and refer to their documentation on how to create and use signed cab files. Shoudl be no big difference though.
    We also need the reverse to download a file to the client - WITHOUT using web.show_document - since this does not always prompt you with a save dialog box & tries to
    open the file in the browser.
    This is a problems with files that the Browser has a MIME type map for. If you download a file with the .gif extension, then this is a known MIME type configured in the HTTP Server. Therefore the Browser recognizes that the downloaded stream is a gif file and tries to render it. You can work around it by making sure that the downloaded file extension is not knwon by the HTTP server (Mime type application/word).
    Frank

  • Question about File upload functionality in Weblogic

    Hi,
        We're currently trying to deploy a web application on the weblogic 12c server (via war file). And the app needs to upload a text file onto the a temperary directory within weblogic server. And on the web page side, we use JQuery File upload plugin.
        My question is, on the file receiver side, does weblogic provide any tools to receive the uploaded file and store it?
    Thanks very much in advance.

    Hi,
    Before setting the string or xstring to server->response->set_cdata (string) or server->response->set_data (xstring) try this:
    CONCATENATE 'attachment;filename=' lv_filename '.xml'  INTO lv_string.
    * Setting the filename by default
      server->response->set_header_field( name  = 'Content-Disposition'
                                          value = lv_string ).
    Hope this helps.
    Regards,
    Abhinav

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

  • JSP : latest  JSTL, File Upload from web form Client to Server Question!

    I understand that within a JSP, It is possible to read a file from the Client by opening a Stream somehow.
    How do I code, within jsp/servlet (non tag) java code inside <% %>
    blocks, WITHOUT openening a new connection to the URL, an InputStream from a client web browser form, from a file upload coded using
    <input type="file" name="file1"/> ?
    I have previously achieved this quite simply with a FileInputStream
    with the previous version of JSTL.
    How may I do this with the latest version of JSTL, with this index.jsp?
    -with a simple text file.
    -with a Binary file (with DataInputStream)?
    <%--
    Document : index
    Created on : 27/01/2009, 3:08:32 PM
    Author : Zachary Mitchell
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1 align="center">Hello World!</h1>
    <form name="form1" method ="POST" >
    <table align="center">
    <tr>
    <td>
    <input name="file1" type="file" align="center"></input>
    </td>
    </tr>
    <tr>
    <td>
    <input type="submit" value="submit" action="index.jsp" ></input>
    </td>
    </tr>
    </table>
    </form>
    <!--*********************************************************************** -->
    <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
    <%@page import = "java.io.*" %>
    <c:if test="${pageContext.request.method=='POST'}">
    <%
    File fileName = new File(request.getParameter("file1"));
    out.println(fileName.toString());
    FileInputStream stream = new FileInputStream(fileName);
    out.println(stream.toString());
    %>
    </c:if>
    <!--*********************************************************************** -->
    </body>
    </html>

    If I have:
    <!-- ***********************************************************************************-->
    <form name="form1" method="POST" enctype="multipart/form-data">
    <input name="file1" type="file"/>
    <input name="submit1" type="submit" value="Submit" action="index.jsp"/>
    </form>
    <!-- ***********************************************************************************-->
    and run this in an index.jsp, use browse to select my text file, and click SUBMIT.
    I can use:
    InputStreamReader reader = new InputStreamReader(new DataInputStream(request.getInputStream()))
    BufferedReader bufferedReader = new BufferedReader(reader);
    bufferedReader.readLine();...
    However, these is some HTML/POST related content around what multiple readLine();
    calls return.
    Is there an easy way, like using "${param.file1}",
    aside from [http://commons.apache.org/fileupload/|http://commons.apache.org/fileupload/],
    maybe using servlet style code, to get the File contents from a remote Client,
    to the remote Server servlet engine, AVOIDING ANY SUPERFLUOUS CONTENT,
    using version 1.12 of the JSTL, JSP 2.0,Tomcat 6?
    Just politely, yes, no, and how?
    Edited by: Zac1234 on Jan 29, 2009 3:27 AM
    Edited by: Zac1234 on Feb 1, 2009 8:29 PM

  • Question about file uploads

    is having a file upload function on a web page a hard thing to do?
    i need to do this, but i do not know where to start...
    if anyone can help me out/shed some light on this for me that would be greatly appreciated!~!!!
    THANKS!

    No it is not particularly difficult; I let the user select a file on the client filesystem then upload to the server.
    The form ENCTYPE must be multipart/form-data:
    <FORM NAME="frmUpload" ENCTYPE="multipart/form-data" METHOD="POST" ACTION=...>
    Use:
    <INPUT TYPE="file" NAME="srcFile" SIZE="15" MAXLENGTH="40">
    In my servlet:
    verify:
    String contentType = request.getHeader("Content-Type");
    if (contentType.indexOf("multipart/form-data") < 0)     {
    ...handle error...
    String boundary = contentType.substring(contentType.indexOf("boundary=") + 9, contentType.length());
    private boolean TransferFile(ServletInputStream is, String srcFile,
    String destDir,String caseNo, String boundary, String errorPage,
    HttpServletRequest request, HttpServletResponse response) throws ServletException
    File pathName = new File(...);
    // If the target directory does not already exist then create it.
    if (!pathName.exists()) {
    pathName.mkdir();
    if (!pathName.exists()) {  // did mkdir work?
    ... do lots more checking ...
    boolean xferOK = false;
    try {
    FileOutputStream fout = new FileOutputStream(...);
    byte[] nextBytes = null;
    byte[] currBytes = null;
    while ((nextBytes = ReadLine(is)) != null) {
    if (currBytes != null) {
    String snippet = "";
    if (nextBytes.length - 10 <= boundary.length())
    snippet = new String(nextBytes);
    if (snippet.indexOf(boundary) < 0)
    fout.write(currBytes, 0, currBytes.length);
    else
    fout.write(currBytes, 0, currBytes.length - 2);
    currBytes = nextBytes;
    fout.close();
    xferOK = true;
    catch (IOException ioe) {
    return xferOK;
    } // TransferFile()
    Hope this helps

Maybe you are looking for

  • ITunes fails to install automatically on Win 7 64-bit computer

    iTune always fails to install automatically, and advises me to select to only download the updates, and then to install them manually. Well, there are five files that download: 1) AppleMobileDeviceSupport64.msi, 2)iTunes64.msi, 3)QuickTime.msi, 4) Qu

  • Message from the IP_IN_QUEUE is automatically dequed

    Hi all, There are 2 messages in the IP_IN_QUEUE. I tried to dequeue it from BPEL using the AQ Adapter, but it is not dequeing. One of the reason could be the Payload structure of the existing messages in the IP_IN_QUEUE is different from the Payload

  • SQL developer some minor anoying problems.

    Hello, can someone please explain to me why i have this problems in SQL developer. First problem is with search db objects. When i type in search string and i tick all objects all shemas it starts search ... finds nothing because search changes "sear

  • Lightroom CC ne se lance pas sur mes macs

    Après installation de Lightroom CC sur mes macs, impossible de lancer le logiciel, je vois juste la page d'accueil furtivement et après plus rien! Merci

  • Navigate to HTML anchor from flash menu

    Hi, I would like to navigate to an html anchor from a flash menu. I use navigateToURL("#anchorName", "_self"). It work fine in IE 7, Firefox 2 and 3 but in safari the page reload. How can I prevent safari from reloading the page ? Thank you !