Struts commons binary file upload issue

Hi,
I was wondering if someone could help me with uploading binary files using jakarta commons file upload. I've looked at several examples and forums and it seems to work but sometimes the binary files that I upload get corrupted. I have no idea why this might be happening. Here is a snippet of my code.
    UploadFileForm uploadFileForm = (UploadFileForm)form;
    FormFile file = uploadFileForm.getFile();
    String dirName = "/tmp/";
    InputStream inputStream = null;
    OutputStream bos = null;
    inputStream = file.getInputStream();
    bos = new FileOutputStream(dirName + file.getFileName());
    int bytesRead = 0;
    byte[] buffer = new byte[4096];
    while ((bytesRead = inputStream.read(buffer, 0, 4096)) != -1) {
        bos.write(buffer, 0, bytesRead);
    }            Am I doing something wrong?
Thanks.
PV

FormFile myFile    = myForm.getTheFile();
    byte[] fileData    = myFile.getFileData();
    BufferedReader in = null;
   try{
       in = new BufferedReader(new InputStreamReader(new   ByteArrayInputStream(fileData)));
       // in = new BufferedReader(new  InputStreamReader(myFile.getInputStream()));
       String str;
        while ((str = in.readLine()) != null) {
                System.out.println(str);
   }catch(Exception exp){
       exp.printStackTrace();
    }finally{
         if(in != null){
            try{
               in.close();
            }catch(Exception ep){
                   ep.printStackTrace();
    } Hope this might help :)
and a small advice please do reactivate archived posts.It'd be lot better if you start with a new one.
Hope there are no hard and fast issues on this.
REGARDS,
RaHuL

Similar Messages

  • File Upload issue in MVC

    Hi,
    For my MVC application, I have created a main controller.
    On the DO_REQUEST of the main controller, I am setting the sub controllers, and directly calling that controller using create_controller, controller_set_active, and call_controller.
    I included dispatch_input( ) in the Main controller's DO_REQUEST method.
    Inside the DO_REQUEST  of the sub controller, I am creating a view using create_view and call_view methods.
    In this view, I have a <htmlb:tableView /> and a <htmlb:fileUpload />, with a button. The issue is that, when the button is clicked, in the DO_HANDLE_EVENT method of the sub-controller, I am not getting the File Data, or the table data.
    For File upload, I use the following -
    data lv_fupld_data TYPE REF TO cl_htmlb_fileupload.
    lv_fupld_data ?= cl_htmlb_manager=>get_data(
                          request = runtime->server->request
                          name    = 'fileupload'
                          id      = 'fupld_1').
    I have the <htmlb:form method       = "post"
                      encodingType = "multipart/form-data" > etc in the view.
    When I call this sub-controller directly from the browser (after including the dispatch_input( ) part in DO_REQUEST), I do not get any issue. I am able to read the file data and upload the file.
    Any Idea why this is happening?

    Hi Rakesh,
    I think I got your problem:
    You only have the htmlb:form in your view of the subcontroller, and not in the main view.
    Therefore the subcontroller works by itself, but not within the main controller.
    If you are including subcontrollers, then make sure the form element is only present in the view of the main controller, wrapping around any subcontroller calls. And don't use the form tag anymore in the subcontrollers.
    Just as you put dispatch_input() just in your top controller, also place htmlb:form only in your top view.
    Regards,
    Max

  • File upload issue in Portlet

    Hi Friends,
    I'm using FileUpload in one of my screen, so I'm using form enctype="multipart/form-data" and using apache commons fileUpload library. The file upload is working fine and I'm navigated from 1st screen to the 2nd screen.
    but in the 2nd screen, I have an anchor link, to navigate back to the 1st screen
    <li><a href="javascript:void (0)" onclick="'<%=renderResponse.createActionURL().toString()+"&paramView=Test1"%>'"> Test1</a></li>.
    When I click the anchor link in the 2nd screen, I'm getting the following exception,
    <ADFPortletServlet> <renderError>
    oracle.adfinternal.view.faces.renderkit.core.portlet.ADFPortletServletException: An error has occurred in the ADFPortletServlet
      at oracle.adfinternal.view.faces.renderkit.html.portlet.ADFPortletServlet.process(ADFPortletServlet.java:429)
      at oracle.adfinternal.view.faces.renderkit.html.portlet.ADFPortletServlet.doGet(ADFPortletServlet.java:349)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:32)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:74)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.adfinternal.model.portlet.psr.InvalidPortletServletRequest: Invalid request made to the portlet servlet.
      at oracle.adfinternal.view.faces.renderkit.html.portlet.ADFPortletServlet.process(ADFPortletServlet.java:380)
      ... 47 more
    Note :  I'm using webcenter 11.1.1.8 and this is WSRP 286 portlet. I'm using plain jsp to develop the portlet.
    Can anyone please help me in solving this exception. Any suggestion would be deeply welcomed.
    Thanks in Advance,
    Felix

    Hi Sreedhar,
    Thanks for your reply. I'm not able to access the document. I get the following message while trying to access the document. Are you able to access the document?
    Document cannot be displayed. Possible reasons are: 
    The document id was entered incorrectly. Please check and try again.
    The document id does not exist (was referenced incorrectly).
    The document is not classified as publicly accessible ("non-public").
    The content is being updated and it is temporarily unavailable but will be made available again soon.
    I don't have any problem in pulling the parameters from a Simple HTML Form with enctype="multipart/form-data" using JSR 286 portlets. But the problem is, if I do submit using the Form with enctype="multipart/form-data", in the next screen, the anchor link is not working, but submit buttons are working in the 2nd screen. If I'm navigated to the 2nd screen using default form enctype, I don't have any problem in the 2nd screen. I'm using Apache commons FileUpload.
    Here is my code.
        public void processAction(ActionRequest request,
                                  ActionResponse response) throws PortletException,
                                                                  IOException {
            if (!isMultiPartForm(request)) {
            // Determine which action.
            String okAction = request.getParameter(OK_ACTION);
            String applyAction = request.getParameter(APPLY_ACTION);
            if (okAction != null || applyAction != null) {
                // Save the preferences.
                PortletPreferences prefs = request.getPreferences();
                String param = request.getParameter(PORTLETTITLE_KEY);
                prefs.setValues(PORTLETTITLE_KEY, buildValueArray(param));
                prefs.store();
                if (okAction != null) {
                    response.setPortletMode(PortletMode.VIEW);
                    response.setWindowState(WindowState.NORMAL);
            String paramView= request.getParameter("paramView");
            PortletSession session=this.getSession(request);
            System.out.println("Setting the param view into the session ........."+paramView);
            session.setAttribute("paramView", paramView);
            }else{
                PortletFileUpload uploader =
                    new PortletFileUpload(new DiskFileItemFactory());
                List<FileItem> items;
                Map<String, String> formFieldsMap =
                    new HashMap<String, String>();
                Map<String, FileItem> nonFormFieldsMap =
                    new HashMap<String, FileItem>();
                try {
                    items = uploader.parseRequest(request);
                for (FileItem item : items) {
                        if (!item.isFormField()) {
                            String fieldName = item.getFieldName();
                            InputStream inpStream = item.getInputStream();
                            nonFormFieldsMap.put(fieldName, item);
                        } else {
                            String fieldName = item.getFieldName();
                            String value = getValue(item.getInputStream());
                            formFieldsMap.put(fieldName, value);
                    String paramView = (String)formFieldsMap.get("paramView");
                    if (paramView.equals("Test3")) {
                        PortletSession session=this.getSession(request);
                        System.out.println("Multi Setting the param view into the session ........."+paramView);
                        session.setAttribute("paramView", paramView);
                } catch (FileUploadException e) {
        private static String getValue(InputStream inp) throws IOException {
            BufferedReader reader =
                new BufferedReader(new InputStreamReader(inp, "UTF-8"));
            StringBuilder value = new StringBuilder();
            char[] buffer = new char[1024];
            for (int length = 0; (length = reader.read(buffer)) > 0; ) {
                value.append(buffer, 0, length);
            return value.toString();
        public boolean isMultiPartForm(ActionRequest request) {
            return PortletFileUpload.isMultipartContent(request);
        public PortletSession getSession(PortletRequest request){
            PortletSession session = request.getPortletSession();
            return session;
    Please provide your inputs.
    Regards,
    Felix

  • Flat file(Binary file) upload using GUI_UPLOAD

    I had uploaded a Binary file Using GUI_UPLOAD , File type was 'BIN'.
    but the data i got in Internal Table was in 0's and 1's.
    whereas i tried the same thing on a different server but  the same Version it gave me the data as text in Internal Table.
    what could be reason..or wat could be done to resolve this.

    Did you declare the internal table used to upload the binary file as TYPE X ?
    begin of itab,
      raw(255) type x,
    end of itab occurs 0.
    CALL FUNCTION 'GUI_UPLOAD'
       exporting
          filetype =  'BIN'
          filename = 'C:DOWNLOAD.BIN'
       tables
          data_tab = itab.
    Always remember to reward snippets you find useful!

  • JClient Binary File Upload and Insert

    We are looking for ways to upload and insert a pdf or other binary file into a view object using JClient on the client tier. Can anyone point us to sample code for this?

    this should do this
    ApplicationModule appmod = panelBinding.getApplicationModule();
    JUApplication app = panelBinding.getApplication();
    ViewObject vo_calldoc = appmod.findViewObject("CallDocsView1");
    Row newdoc = vo_calldoc.createRow();
    newdoc.setAttribute("CdcCalId", PanelCallView3.vo_call.getRowSet().getCurrentRow().getAttribute("CalId"));
    newdoc.setAttribute("CdcFilenaam",file.getName());
    newdoc.setAttribute("CdcBlob",blob);
    vo_calldoc.insertRow(newdoc);
    appmod.getTransaction().postChanges();
    Object[] inskey = new Object[]{ newdoc.getAttribute("CdcId")};
    appmod.getTransaction().commit();
    Key pkkey = new Key(inskey);
    Row[] rowarray = vo_calldoc.findByKey(pkkey,1);
    Row updrow = rowarray[0];
    System.out.println(updrow.getAttribute("CdcFilenaam"));
    updrow.lock();
    oracle.jbo.domain.BlobDomain myblob = (oracle.jbo.domain.BlobDomain)updrow.getAttribute("CdcBlob");
    int next;
    FileInputStream fileIn = new FileInputStream(file);
    OutputStream blobOut = myblob.getBinaryOutputStream();
    while ((next = fileIn.read()) != -1)
    blobOut.write(next);
    fileIn.close();
    blobOut.close();
    app.commitTransaction();

  • File Upload issues

    There is a file upload that I have and I am getting an
    error...
    Notice: Undefined variable: file_list in
    C:\vhosts\mysite\upload\index.php on line 20
    On line 20 in my php page happens to be the following code
    that is giving an error...$file_list .= "<option value=\"$file\"
    >$file</option>";
    <?php
    #for windows...
    $dirname = $_SERVER['DOCUMENT_ROOT'].'/_assets/professor/';
    //$dirname = "C:\\wamp\\www";
    #(for Linux... $dirname = "user/local/apache/bin";)
    $dir = opendir($dirname);
    while(false != ($file = readdir($dir))){
    if(($file != ".") and ($file != "..")){
    $file_list .= "<option value=\"$file\"
    >$file</option>";
    closedir($dir);
    ?>
    This is what is in the body...
    <form enctype="multipart/form-data" action="uploaded.php"
    method="POST">
    <fieldset><legend>Upload Professor
    Image</legend>
    <!-- MAX_FILE_SIZE must precede the file input field
    -->
    <!--input type="hidden" name="MAX_FILE_SIZE"
    value="30000" /-->
    <!-- Name of input element determines name in $_FILES
    array -->
    Send this file: <input name="userfile" type="file" />
    <div align="center"><input type="submit"
    value="Send File" /></div>
    </fieldset>
    </form>
    <br>
    <br>
    <form action="delete.php" method="post">
    <fieldset><legend>Delete Professor
    Image</legend>
    <select name="deleteFile">
    <?php echo($file_list); ?>
    </select>
    <div align="center"><input type="submit" name="go"
    value="Delete File"></div>
    </fieldset>

    AdonaiEchad wrote:
    > There is a file upload that I have and I am getting an
    error...
    > Notice: Undefined variable: file_list in
    C:\vhosts\mysite\upload\index.php on
    > line 20
    > On line 20 in my php page happens to be the following
    code that is giving an
    > error...$file_list .= "<option value=\"$file\"
    >$file</option>";
    What that's telling you is that you're adding a value to a
    variable that
    doesn't yet exist. In your case, it probably doesn't matter,
    but using
    undefined variables is a potential security risk. To
    eliminate the
    warning - and the risk - declare $file_list before using it:
    $file_list = '';
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • File Upload issue in 4.0

    Hi,
    I'm having problems with a file upload feature that no longer works after upgrading to 4.0. It used a stored procedure - it's old.
    ORA-20001: Invalid PL/SQL expression condition: ORA-06550: line 1, column 49: PLS-00103: Encountered the symbol "), false ); end;" when expecting one of the following: . ( ) , * @ % & | = - + < / > at in is mod remainder not range rem => .. <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
         Error      ERR-1024 Unable perform processing.
    I can't find what this is using the debug because it doesn't seem to show what caused the error:
    0.17200     0.00000     ...Do not run process "EMAIL: Manager Notification", process point=AFTER_SUBMIT, condition type=PLSQL_EXPRESSION, when button pressed=     3     
         0.17200     0.00000     Show ERROR page...     3     
         0.17200     0.00000     Performing rollback...     3     
         0.18700     0.00000     Processing point: After Error Header     3     
         0.18700     0.00000     Processing point: Before Error Footer     3     
         0.18700     -     ...Determine if user "MTERLESK" workspace "994601184274887" can develop application "20000" in workspace "994601184274887"     3     -
    I'm trying to rebuild the file upload from scratch but am now getting this error:
    Error      ORA-20001: Error: At most one DML process may be declared per page.
    I've had multiple DMLs on a page before.
    Any help is GREATLY appreciated.
    Thanks
    Matt

    I found it. It was part of a PL/SQL condition in an unrelated page process. I had a typo in the condition and that page process was never used.
    This was allowed to be saved in 3.1:
    :REQUEST in (GO')
    but when moving to 4.0, you had to edit the page process to see that there was an error due to the missing left single quote.
    thanks
    Matt
    Edited by: mterlesky on Aug 11, 2010 1:15 PM

  • Flex file upload issue with large image files

         Hello, I have created a sample flex application to upload an image and also created java servlet to upload and save image and deployed in local tomcat server. I am testing the application in LAN. I am able to upload small as well as large image file(1Mb) from some PCs but in some other PCs I am getting IOError while uploading large image files however it is working fine for small images. Image uploading is hanging after 10%-20% and throwing IOError. *Surprizgly it is working Ok with XP systems and causeing issues with Windows7 systems*.
    Plz give me any idea to get a solution.
    In Tomcat server side it is giving following error:
    request: org.apache.catalina.connector.RequestFacade@c19694
    org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
            at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:371)
            at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.ja va:126)
            at flex.servlets.UploadImage.doPost(UploadImage.java:47)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
            at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
            at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProto col.java:594)
            at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
            at java.lang.Thread.run(Thread.java:722)
    Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly
            at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStre am.java:982)
            at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:8 86)
            at java.io.InputStream.read(InputStream.java:101)
            at org.apache.commons.fileupload.util.Streams.copy(Streams.java:96)
            at org.apache.commons.fileupload.util.Streams.copy(Streams.java:66)
            at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:366)
    UploadImage.java:
    package flex.servlets;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    import java.util.regex.*;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.*;
    import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class UploadImage extends HttpServlet{
             * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
             *      response)
            protected void doGet(HttpServletRequest request,
                            HttpServletResponse response) throws ServletException, IOException {
                    // TODO Auto-generated method stub
                    doPost(request, response);
            public void doPost(HttpServletRequest request,
                            HttpServletResponse response)
            throws ServletException, IOException {
                    PrintWriter out = response.getWriter();
                    boolean isMultipart = ServletFileUpload.isMultipartContent(
                                    request);
                    System.out.println("request: "+request);
                    if (!isMultipart) {
                            System.out.println("File Not Uploaded");
                    } else {
                            FileItemFactory factory = new DiskFileItemFactory();
                            ServletFileUpload upload = new ServletFileUpload(factory);
                            List items = null;
                            try {
                                    items = upload.parseRequest(request);
                                    System.out.println("items: "+items);
                            } catch (FileUploadException e) {
                                    e.printStackTrace();
                            Iterator itr = items.iterator();
                            while (itr.hasNext()) {
                                    FileItem item = (FileItem) itr.next();
                                    if (item.isFormField()){
                                            String name = item.getFieldName();
                                            System.out.println("name: "+name);
                                            String value = item.getString();
                                            System.out.println("value: "+value);
                                    } else {
                                            try {
                                                    String itemName = item.getName();
                                                    Random generator = new Random();
                                                    int r = Math.abs(generator.nextInt());
                                                    String reg = "[.*]";
                                                    String replacingtext = "";
                                                    System.out.println("Text before replacing is:-" +
                                                                    itemName);
                                                    Pattern pattern = Pattern.compile(reg);
                                                    Matcher matcher = pattern.matcher(itemName);
                                                    StringBuffer buffer = new StringBuffer();
                                                    while (matcher.find()) {
                                                            matcher.appendReplacement(buffer, replacingtext);
                                                    int IndexOf = itemName.indexOf(".");
                                                    String domainName = itemName.substring(IndexOf);
                                                    System.out.println("domainName: "+domainName);
                                                    String finalimage = buffer.toString()+"_"+r+domainName;
                                                    System.out.println("Final Image==="+finalimage);
                                                    File savedFile = new File(getServletContext().getRealPath("assets/images/")+"/LowesFloorPlan.png");
                                                    //File savedFile = new File("D:/apache-tomcat-6.0.35/webapps/ROOT/example/"+"\\test.jpeg");
                                                    item.write(savedFile);
                                                    out.println("<html>");
                                                    out.println("<body>");
                                                    out.println("<table><tr><td>");
                                                    out.println("");
                                                    out.println("</td></tr></table>");
                                                    try {
                                                            out.println("image inserted successfully");
                                                            out.println("</body>");
                                                            out.println("</html>");  
                                                    } catch (Exception e) {
                                                            System.out.println(e.getMessage());
                                                    } finally {
                                            } catch (Exception e) {
                                                    e.printStackTrace();

    It is only coming in Windows 7 systems and the root of this problem is SSL certificate.
    Workaround for this:
    Open application in IE and click on certificate error link at address bar . Click install certificate and you are done..
    happy programming.
    Thanks
    DevSachin

  • APEX 3.1.2 Static File Upload Issues

    We are still running on APEX 3.1.2 though we hope to go to 4 very soon.
    We had a production problem this past week that is perplexing. I have seen other posts referencing similar issues but no solutions.
    We have an application that has several Static File Javascripts (.js). We already ran into the IE Upload bug so we only upload in Mozilla now.
    We had changes to one of the .js files (identity.js). I deleted the old file using the Shared Components screen and uploaded the new one. The action was "Successful" but the file was still the old version. We deleted a file of 73 lines of code and uploaded a new version of 28 lines. After successful upload, we still would get the 73 line version . The app was still getting that version too.
    I deleted it many times and tried again. I ran scripts to do both the delete and upload. I even deleted the file manually from the FLOWS_FILES table that held it. Still got the old version.
    We bounced the server (thinking it was cached somewhere) - still got the old version. Finally, in desperation, I started cloning the app to another app number in another Workspace. Since we use aliases, I thought I could use a clean Workspace and uplad the new file there. This worked but - suddenly the old Workspace started using the correct file.
    Is ther some secret cache somewhere that needs to be cleared out? I did not want to start randomly clearing out caches and there is no documentation on this issue.
    Is it something about our config - we have Oracle HTTP Server, OC4J, and modplsql for this environment with a 10g database.
    Any insight would be appreciated - my manager does not like "it fixed itself magically".

    We ruled out the browser caching by trying the app on several other people's PCs.
    I am thinking it is being cached somewhere in the APEX server environment but cannot find any documentation on where or what that might be.
    I think I might have triggered a refresh when I was trying to implement a cloned version (in a different Workspace). It seems that the scope of a JS file is within its Workspace so we figured that a new Workspace would treat the changed file as a new file - and it did. During this process, we had duplicate ALIAS for a minute and I think that confused the APEX App Engine and triggered the refresh.
    But that is a SWAG opinion.
    I also thought of "versioning" the JS files but our developers are not too keen. If we don't find another solution, that may be what we have to do.

  • File upload - issue with European .csv file format

    All,
    when uploading the .csv file for "Due List for Planned Receipts" in the File Transfer Upload center I receive an error.  It appears that it is due to the european .csv file format that is delimited by semicolon rather than comma. The only way I could solve this issue is to change Regional and Language options to English. However, I don't think this is a great solution as I can't ask all our suppliers to change their settings.  Has anyone come across this issue and another way of solving it?
    Thank you!
    Have a good day,
    Johanna

    Igor thank you for your suggestion. 
    I found this SAP note:
    +If you download a file, and the formatting of the CSV file is faulty, it is possible that your column separator does not match the standard settings of the SAP system. In the standard SAP system, the separator is ,.
    To ensure that the formatting is correct, set your global default for column separation in your system, so that it matches that of the SAP system you are using.+
    To do that Microsoft suggests to change the "List separator" in the Regional and Language Options Customize view. Though like you suggest that does not seem to do the trick. Am I missing something?
    However, if I change the whole setting from say German to English (UK) the .csv files are comma delimited and can be easily uploaded.  Was hoping there would be another way of solving this without need for custom development.

  • CF8.01 Large Files Upload issue

    We are having an issue with posting large files to the server
    through CFFile. Our server is running on Windows 2003 R2 SP2 with
    2GB of RAM. The average upload size is 800MB and we may run into
    multiple simultaneous uploads with the large file size. So, we have
    adjusted the "Maximum size of post data" to 2000 MB and "Request
    Throttle Memory" to 5000 MB in the ColdFusion admin setting to
    hopefully can allow up to 5 simultaneous uploads.
    However, when we tried to launch two 800MB uploads at the
    same time from different machines, only one upload can get through.
    The other one returned "Cannot connect to the server" error after a
    few minutes. No errors can be found in the W3C log and the
    ColdFusion logs (coldfusion-out.log and exception.log) but it is
    reported in the HTTPErr1.log with the following message:
    2008-04-18 08:16:11 204.13.x.x 3057 65.162.x.x 80 HTTP/1.1
    POST /testupload.cfm - 1899633270 Timer_EntityBody DefaultAppPool
    Can anyone shed some light of it? Thanks!

    quote:
    Originally posted by:
    Newsgroup User
    Don't forget that your web server (IIS, Apache, etc.) can
    have upload
    throttles as well.
    We did not throttle our IIS to limit the upload/download
    bandwidth.
    Is there a maximum limit for "Request Throttle Memory"
    setting? Can we set it over the available physical RAM size?

  • Multiple file upload issues

    I'm trying to create a simple web form capable of uploading multiple image files. I've followed the instructions as per  July 12, 2012, " Customizing Web Forms", "Adding multiple file attachment fields to the web form" and everthying seems to indicate that's it working, however when I go to "related files under cases I only see one file. Any ideas?

    Yes, you'll find it here: http://www.pikassopets.com/order/upload

  • Raw file upload issue

    Suddenly Bridge has stopped uploading RAW (.NEF) files from my Nikon D80. I only get the .jpgs. I can't figure out why. I'm running Photoshop CS3 with the 8.1 converter and Bridge CS3...
    Anyione have an idea???

    I am working from the camera, which had worked previously, as I have no card reader.
    I have many hundreds of gigabytes free...I am able to copy the .NEF files off the camera via the Windows copy utility...it just seems as if Bridge suddenly doesn't recognize the .NEFs...
    Bizarre!

  • 9iAS DAD file upload

    I have no problem with HTMLDB running against the OHS that installed with my 9i database server. When I create a DAD on my 9iAS server and access HTMLDB on the database everything but the file upload seems to work. What am i missing?
    ANdrew

    the four DAD parameters that play into the file upload process are PlsqlDocumentTablename, PlsqlDocumentPath, PlsqlDocumentProcedure, and PlsqlNLSLanguage. our default install would have you set up the first three parms as...
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDocumentPath docs
    PlsqlDocumentProcedure wwv_flow_file_manager.process_download
    ...the PlsqlNLSLanguage parameter's value is specific to your db setup. to figure out that value, you could run this proc...
    set serveroutput on;
    declare
    l_NLS_LANGUAGE varchar2(100) default null;
    l_NLS_TERRITORY varchar2(100) default null;
    l_NLS_CHARACTERSET varchar2(100) default null;
    begin
    select value
    into l_NLS_LANGUAGE
    from nls_database_parameters
    where parameter = 'NLS_LANGUAGE';
    select value
    into l_NLS_CHARACTERSET
    from nls_database_parameters
    where parameter = 'NLS_CHARACTERSET';
    select value
    into l_NLS_TERRITORY
    from nls_database_parameters
    where parameter = 'NLS_TERRITORY';
    sys.dbms_output.put_line ( 'nls_language = {'||l_NLS_LANGUAGE ||'}');
    sys.dbms_output.put_line ( 'nls_territory = {'||l_NLS_TERRITORY ||'}');
    sys.dbms_output.put_line ( 'nls_characterset = {'||l_NLS_CHARACTERSET ||'}');
    sys.dbms_output.put_line ( 'add this line to your DAD config:');
    sys.dbms_output.put_line ( 'PlsqlNLSLanguage '||l_NLS_LANGUAGE||'_'||l_NLS_TERRITORY||'.'||l_NLS_CHARACTERSET );
    end;
    i'm hoping that correctly setting up these four DAD parameters will fix your file upload issue. if not, please do let us know (including specific details).
    thanks,
    raj

  • Getting error while file uploading in struts

    Hi!
    I am getting this error while file uploading,I can't find any solution.
    SRVE0026E: [Servlet Error]-[org.apache.commons.fileupload.FileUpload: method setSizeMax&#40;I&#41;V not found]: javax.servlet.ServletException: org.apache.commons.fileupload.FileUpload: method setSizeMax(I)V not found
         at com.honeywell.sdm.base.controller.SDMActionServlet.service(SDMActionServlet.java:75)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
         at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    Please help me.I have attached the bean,action ,jsp pages
    uploadInfo.jsp
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html>
    <HEAD>
    <script>
    function submitting(){
    document.uploadForm.operation.value = "uploadOrgAdj";
    document.uploadForm.action = "/uploadRecAction.do";
    document.uploadForm.submit();
    </script>
    </HEAD>
    <body>
    <html:form action="/uploadRecAction" method="post" enctype="multipart/form-data">
    <b>Select the .xls File to upload data </b>
    <html:file property="fileName"></html:file>
    <html:hidden property="operation" value=""/>
    <html:button property="btn" value="Submit" onclick="submitting()"></html:button>
    </html:form>
    </body>
    </html:html>
    uploadAdjForm :
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.upload.FormFile;
    public class uploadAdjForm extends ActionForm{
         private FormFile fileName;
              * @return
              public FormFile getFileName() {
                   System.out.println("getFileName"+fileName);
                   return fileName;
              * @param string
              public void setFileName(FormFile string) {
                   System.out.println("setileNmame"+string);
                   fileName = string;
    Action:
    public class uploadFinancialAdjAction extends DispatchAction{     
         public org.apache.struts.action.ActionForward uploadOrgAdj(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception {
              String sForward = "UploadInfo";               
              HttpSession session = request.getSession();          
              String sStartIndex = null;
              String sEndIndex = null;
    try
         uploadFinancialAdjForm UploadForm=(uploadFinancialAdjForm)form;
         System.out.println(UploadForm.getFileName().getContentType().toString());
         String file=UploadForm.getFileName().toString();     
    uploadFinancialAdjManager businessManager = new uploadFinancialAdjManager();
         ArrayList fileName = new ArrayList();                                   fileName = businessManager.getOrgAdjDetails(file);
              boolean isMultipart = FileUpload.isMultipartContent(request);
              if(isMultipart){
              // Create a new file upload handler
              DiskFileUpload upload = new DiskFileUpload();
              // Parse the request
              List items = upload.parseRequest(request);
              //Process the uploaded items
              Iterator iter = items.iterator();
              while (iter.hasNext()) {
                   FileItem item = (FileItem) iter.next();
                   if (item.isFormField()) {          
              //processFormField(item);
              if(item.getFieldName().equalsIgnoreCase("txtStartIndex")){          
                   sStartIndex = item.getString();          
              else if(item.getFieldName().equalsIgnoreCase("txtEndIndex")){
                             sEndIndex = item.getString();          
    uploadFinancialAdjForm UploadForm=(uploadFinancialAdjForm)form;
                             String file=UploadForm.getFileName().toString();               
              uploadFinancialAdjManager businessManager = new uploadFinancialAdjManager();
                             ArrayList fileName = new ArrayList();
                             fileName = businessManager.getOrgAdjDetails(file);
              }else{
                   if(item.getName()!=null && !item.getName().toUpperCase().endsWith(".XLS")){
              throw new Exception("Please browse an excel file and Upload");
              session.setAttribute("fileItem",item);
              }//end of while
              session.setAttribute("startIndex",sStartIndex);
              session.setAttribute("endIndex",sEndIndex);
              request.setAttribute("FileUploadStatus","true");
              else{
              throw new Exception("Error:Form is not multipart");
    catch(Exception e)
         System.out.println(e);
         return mapping.findForward(sForward);
    }

    ORA-06512: at "PREPRD.OIM_SP_RECONARCHIVAL", line 722
    ORA-00942: table or view does not exist
    ORA-01031: insufficient privileges
    (1) Check whether the OIM_SP_RECONARCHIVAL table or view exists or not...
    (2) If it exists, check whether the DEV_OIM user has enough privilege to view this table or not...
    If not, give it all privilege by login as sys as sysdba
    GRANT ALL PRIVILEGES TO DEV_OIM;
    COMMIT;

Maybe you are looking for

  • Problem with my E70 Nokia

    i have bought this mobile since 3 months. The problem i had and i ask you kindly to to help me: When i put name in the contacts the messages will not be delivered to my mobile, so if somebody wants to send me message he must be not in my contacts. Wh

  • SeeBurger Message Splitter State accepted or partially accepted

    Hi, The requirement is that if we receive an EDI interchange with multiple transaction sets and if some of them are rejected due to EDI data errors, only those transaction sets in error should be ignored for processing and the ones without errors sho

  • SOP process in APO

    Hi  Experts, We are planning to execute SOP process in APO (12 months), Could you please suggest how to setup Planning area Key figures for SOP (SAP has not complete development for SNP01 planning area) Example: we have Consensus forecast key figure

  • MDX with External Hierarchy

    Hi, I have a problem with querying a BEx query cube by MDX. The BEx query contains an external hierarchy that facilitates MDX functions such as Generate(). The MDX query is working in MDXTEST transaction code in BW system. However the error - "system

  • Can I set skip=1 in control file?

    Below is my control file, how can I modify it to skip the first row in my datafile? (the first row is the column header row), I have read some related posts, couldn't find the fix, please help LOAD DATA INFILE 'class.data' BADFILE 'class.bad' DISCARD