7 Replies Latest reply: Aug 30, 2013 5:50 AM by Timo Hahn RSS

    Uploading multiple files programmatically

    sazz619


      Hi,

       

      I am building an application in ADF using Jdev 11.1.1.4.0.

      Here i have a <af:inputFile> which uploads a .csv file. In this .csv file i have a column containing some filepaths, below is the snapshot from my .csv file

       

      Full File Path
      C:/Documents and Settings/user/My Documents/*****/Upload/Test.pdf
      C:/Documents and Settings/user/My Documents/*****/Upload/Check.pdf

       

      Now i am reading this .csv file and when i get the "fullFilePath" value , i read the file mentioned in the path using the below code:

            File uploadedFile;

            uploadedFile = new File(fullFilePath);

       

            if (uploadedFile != null)

            {

                pdffilename = uploadedFile.getPath().substring(uploadedFile.getPath().lastIndexOf("\\") + 1);

                pdfcontentType = new MimetypesFileTypeMap().getContentType(uploadedFile);

                pdfsize = uploadedFile.length();

                String extn = pdffilename.substring(pdffilename.lastIndexOf(".") + 1);

               

                        FileInputStream fis = new FileInputStream(uploadedFile);

                        BlobDomain blob = parseISToBlob(fis,pdfsize);

           }

      I am doing this as i have to read all the files from the filepaths mentioned in the .csv file and upload them into a blob data directly while Uploading the csv file itself.

      This piece of code is running perfectly fine when i test this on the local IntegratedWeblogicServer. But when i deploy it to a StandAlone Server it seems the code is not able to read the file,mentioned in the .csv row, from the client machine path ("C:/Documents and Settings/user/My Documents/*****/Upload/Test.pdf").

       

      Could you please suggest me some ways to do this?