8 Replies Latest reply: May 15, 2013 5:05 PM by Timo Hahn RSS

    File Attachment

    User_Sep
      Hi,

      I am using JDev 11.1.1.5.0, I am very new to file attachment in ADF, Can you please anyone guide me by suggesting some document.


      Regards,
      Arun
        • 1. Re: File Attachment
          Mohammad Jabr
          I suggest you read Timo's blog
          http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-1/
          http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
          http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/
          • 2. Re: File Attachment
            User_Sep
            Thanks Jabr.

            -Arun
            • 3. Re: File Attachment
              User_Sep
              Hi Jabr,

              Thanks for your document, I am getting some problem shown below,

              The '*ContentTypes*' marked below is not recognized in my application. Also my valuechage listener doesn't recognize this method

               public void FileUpload(ValueChangeEvent valueChangeEvent)
                  {
                  System.out.println("Inside Method");
                  UploadedFile file = (UploadedFile) valueChangeEvent.getNewValue();
                  String fileName = file.getFilename();
              String contentType = *+ContentTypes+*.get(fileName);
                  System.out.println("Before Binding");
                  DCBindingContainer lBindingContainer =(DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
                  DCIteratorBinding lBinding = lBindingContainer.findIteratorBinding();
                  Row newRow = lBinding.getCurrentRow();
                  newRow.setAttribute("filename", fileName);
                  newRow.setAttribute("file", createBlobDomain(file));
                newRow.setAttribute("ContentType", contentType);
                  }
              How can I fix it?

              Arun
              • 4. Re: File Attachment
                Mohammad Jabr
                Comment from Timo's blog
                >
                If you look into the sample application you’ll find the class ContentTypes (in package BlogUploadDownload\ULDLViewController\src\de\hahn\blog\uldl\view\util) which gets a file name an calculates the MIME type from the extension of the file name.
                • 5. Re: File Attachment
                  User_Sep
                  Hi,

                  I run the sample project from http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-1/

                  All works fine.

                  But when I try to download the attached Image file from the table. It is downloading to my drive with size of Zero bytes, Is there any case to handle this problem?

                  Regards,
                  Arun
                  • 6. Re: File Attachment
                    Timo Hahn
                    There are at least two versions of the sample, can you please tell me which one you have used?
                    In any case you should use hte one linked in part 3 of the series as a base. You need to make some changed to the application as it's developed for 11gR2 (11.1.2.1.0 and higher) and I guess you can't just run in when you open it in 11.1.1.5.0.
                    The concept is the same, but you may have to change the ui a bit.

                    Timo
                    • 7. Re: File Attachment
                      User_Sep
                      Hi ,

                      I run that sample application in Jdev 11.1.2.3.0, I can access it in my browser. But when I try to download the attached Image file from the table. It is downloading with size of Zero bytes. The same problem persist again.
                      The concept is the same, but you may have to change the ui a bit.
                      Timo, can you please guide the changes in UI for R1.

                      -Arun
                      • 8. Re: File Attachment
                        Timo Hahn
                        I backported the sample application. Check http://tompeez.wordpress.com/2013/05/16/handling-imagesfiles-in-adf-part-4/ for the download link

                        Timo