Problem in upload PDF file using Apache HttpClient3.1

Hi:
I am using Apache HttpClient 3.1 to upload pdf image from a STANDALONE java application to remote server (Weblogic9.1). Here are some questions:
1) Do i have to use multipartpost method? (I am uploading pdf image one by one)
2) The pdf image is added to request as:
HttpClient client = new HttpClient();
PostMethod method = new PostMethod("myServletUrl");
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
InputStreamRequestEntity entity = new InputStreamRequestEntity(new FileInputStream(file), "application/pdf");
method.setRequestEntity(entity);
method.setRequestHeader("Content-type", entity.getContentType());
int statusCode = client.executeMethod(method);
3) On server side, a servlet will save the posted pdf image as (Apache FileUpload is not used here):
InputStream is = req.getInputStream();
saveFile(is, fileName); // write this input stream to file.
The above steps 2 and 3 will create a pdf file on remote server with MUCH REDUCED size. Any idea what's the problem? content-type problem?
4) An working example link will be great.
thanks

Dunno, but as this is a client side issue, the solution, if there is one will lie in the HTML / javaScript.
If you dont get an answer in here, have google for an HTML solution, which you can then write out in your jsp.

Similar Messages

  • I have a problem with uploading pdf files. This was raised in April by Mariano and the solution given - but the link to the solution does not work. How do I get to the solution?

    I have just come across this problem uploading pdf files on FF 3.6. Mariano posted this same problem on 5 Apr ( I found his post after a Google search as a search of this Forum gave no result). It is shown as "solved" but when I click on the Show Solution link it just loops back to the question.
    How do I get to see the solution?

    The following line tells me that this is not a template file, but a document created from a template called index.dwt
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->
    This means that you saved a child document as a template file at some stage.
    If you go to Modify->Templates->Detach from Template, you can remove the template structure from your document. All you then need to do is to re-save the document as a template.

  • Problem in Uploading excel file using WebDynpro for Java

    Hi  All
    I have followed for Uploading excel file using WebDynpro for Java added by  Tulasi Palnati
    I done all, but I'm getting 500 Exception please contact u r system admin meag  at run time also  Jxl/Workbook class not found msag  but i downloaded Jxl.jar file and  there is no error signals  in coding part. How can I solve the Problem.
    Thanks
    Polaka

    Please ask the people in the Web Dynpro Java forum for a solution.

  • Problem in uploading a file using Ws_upload.

    Hi Experts,
                        I am using WS_UPLOAD for uploading .xls file into SAP Standard table T558A.
    Problem is file is not uploaded to DB table.....getting error like
    ERROR DURING FILE UPLOAD/DOWNLOAD as  pop up message.....
    can any boady please help on this issue.
    Regards,
    Praveena.

    Hi,
    If you want to upload the data using EXCEL file use the function module ALSM_EXCEL_TO_INTERNAL_TABLE.
    Examples for ALSM_EXCEL_TO_INTERNAL_TABLE.
    http://wiki.sdn.sap.com/wiki/display/Snippets/Howtouse+FM'ALSM_EXCEL_TO_INTERNAL_TABLE'

  • Performance problems to generate PDF files using CR

    Hi,
    I develop an application that read TXT files and uses this information to generate PDF files, but I'm having problems with performance to generate this PDF, each files are taking at least 1 minute to create the file. I realized that some TMP and RPT files are generated and deleted in the temp folder of the machine which is running the application, but after some time creating the PDF's the RPT files aren't deleted and I have an exception on my app:
    Memory full.
    Failed to export the report.
    Not enough memory for operation.    at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
    The server who is running this application is a Dual Core AMD Opteron 2.61 ghz, 7 GB RAM
    The framework version is 2.0 and the Crystal Reports dll version is 10.5.3700.0
    Thanks.

    Hi,
    If you are using IIS5 the give aspnet full permission to the Temp folders. For IIS6 give  IIS_wpg permission.
    For this you need to right click on the folder,
    go to properties,
    security tab,
    click on Add,
    Type aspnet/iis_wpg,
    select top note in Location and click on check on check names.
    Give full control and
    click ok.
    Also try using GC.Collect(), reportDocObject.Close() and reportDocObject.Dispose() as clean up code.
    Regards,
    AG.

  • Problem in opening PDF files using Reader 8 when created with iText 2.1.3

    We are facing problem in using IText version 2.1.3. We are using Acrobat Reader 8.1 for viewing the PDF documents. In our Shell program we are splitting and merging the pdf documents using IText. The pdf document works correctly and is readable for documents with one page while it fails for documents with multiple pages.Also please note that it works fine with the older Arcobat reader version say version 7.0 and below but since business has migrated to acrobat higher version we expect IText to work in sync.
    We have already raised a bug with the iText and got the information from them stating that the problem is due to the over nesting of XObjects, which has a threshold value of 50 and was discarded in earlier versions but got flagged in Acrobad Reader 8. Also note that we have reported a bug with the adobe development team.
    We tried working with other Java PDF tools (jPDFProces), to manupulate the pdf files but were facing the same problem. Hence we understand that the problem is with Adobe Reader 8 as the manupulated pages are being viewed in Adobe Reader 7, but fails to read in Adobe Reader 8.
    Kindly provide us with a solution.
    Thanks and Regards,
    Kiran R
    Sonata software.com
    www.sonata-software.com

    Conte Pietro
    [email protected]
    Buon Giorno
    Ho un problema riguardo Adobe Reader.
    La vecchia versione Adobe 8.1.1 non mi apre più i files in formato PDF.
    Ho provato ad installare l'ultima versione Adobe 9 , arriva fino ad un passo dal completamento ma non riesce a terminare. mi da il seguente errore:
    ERROR 1714 The older version of Adobe Reader 9 cannot be removed.
    Contattare l'assistenza!
    Ho cancellato tutti i riferimenti Adobe dal DeskTop, dal Pannello di Controllo e dal FILES Programmi, ma niente!
    Vi sarei grato se potete mandarmi un dettagliato help per riuscire a completare l'installazione.
    Grazie
    [email protected]
    [email protected]

  • Providing security to the PDF file using apache FOP in java

    I am working on PDF file generation using Apache FOP, I have security concerns which are
    1. PDF file will be placed in a folder after generation and that should not be copied to other locations.
    2. PDF file should only have an option print nothing else. The save/save as options should never be enabled.
    3. PDF expiry date is required, so that PDF file will get expire after duration.

    HI,
    I did that too, with too much experiments.
    Code snippet for reference.
    PdfReader reader = new PdfReader(getOutputFilePath());
    PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("my-new-file.pdf"));
    stamper.setDuration(1,1);
    int permissions = PdfWriter.HideMenubar & PdfWriter.HideToolbar & PdfWriter.HideWindowUI & ~( PdfWriter.AllowCopy | PdfWriter.AllowModifyAnnotations | PdfWriter.AllowFillIn | PdfWriter.AllowAssembly | PdfWriter.AllowModifyContents | PdfWriter.AllowScreenReaders);
    stamper.setEncryption(null, null,
    permissions, PdfWriter.STRENGTH40BITS);
    stamper.setFormFlattening(true);
    System.out.println(stamper.getMoreInfo());
    stamper.close();
    I am able to disable the save button, but I am unable to disable the save as option.
    It would be great help, if you can give some inputs on this.

  • Problem in uploading PDF file greater than 450Kb in portals

    Hi All,
            There is aproblem when we upload a PDF file of size greater than 450 KB in portals,it shows some error.
    Do i need to change any server settings for this or any other configuration is required.
    Help will be appreciated
    Thanks in Advance

    Hi Amit,
    Pls check the thread below:
    /message/1634863#1634863 [original link is broken]
    Hope this helps.
    Regards,
    venkat

  • Serial no. invalid problem and problem with creating PDF file using adobe acrobat x pro

    I tried to download adobe X pro on my new computer and entered the serial No, bu the program said the number is invalid. Actually the number is valid, confirmed by the info listed in my account. please help! also I downloaded the trial version now, but when I use it, the file it created is not shown as adobe file, but as firefox HTML file. I don't know why. please help!

    Error "The serial number is not valid for this product" | Creative Suite

  • How to upload a pdf file using webdynpro abap

    Hi Experts,
    I need to upload pdf files using webdynpro abap.my question is where to upload this files and how to upload this files, and how to display this pdf file.
    Please Provide Requried Information.
    Waiting for Reply.
    Thanks & Regards.
    Bhushan.

    Hi,
    There is a UI element with the type 'File Upload'.
    You can use that in your view.
    For further details and coding, please refer to
    [http://www.****************/Tutorials/WebDynproABAP/Upload/Page1.htm]
    Hope this helps you.
    Regards,
    Dolly

  • Problems converting a pdf file to a word document using ExportPDF

    I am having problems converting a pdf file to a word document (.docx) using ExportPDF. It is spends ages trying to upload the PDF file, but fails to do so. Should I just cancel my subscription?

    I suspect that you are asking for help with CreatePDF. If so, you should post in
    http://forums.adobe.com/community/createpdf
    This is the Reader forum...

  • Problem reopening and/or refreshing PDF files using Acrobat Reader V. 8.0

    I upgraded to Adobe Acrobat Reader V. 8.0 and have encountered problems refreshing PDF files in the Safari 2.0.4 browser when I am logged into the secure area for Value Line Publishing. Some of the PDF Files in this area can be opened and/or refreshed multiple times. Other PDF files in this area allow me to open them once. I cannot reopen those previously viewed files (or refresh the screen) -- after refreshing, the window changes to a blank white screen, and the files do not reopen.
    I am perplexed because I do not have difficulty refreshing the PDF files (within Safari) using the native PDF viewer, I did not have problems refreshing files using Acrobat Reader V. 7.0 and I do not appear to have problems refreshing PDF files using Acrobat Reader V. 8.0 when I am outside the secure area or on other web sites.
    I have replaced the Acrobat Reader plug-in, manually removed all remnants of previous versions of Acrobat Reader and reinstalled V. 8.0. and I also upgraded from Mac OS 10.4.8 to 10.4 9, all to no avail.
    I can clear the Safari cache files as a temporary solution, but I encounter the same difficulties with the “problematic” files once they have been opened again.
    I can also download the PDF files to my hard drive and refresh them multiple times within Safari and also using Acrobat Reader V. 8.0
    The software personnel at Value Line Publishing have investigated their system and have referred me back to Apple. Has anyone heard of similar problems associated with Adobe Acrobat Reader V. 8.0 used in conjunction with Safari 2.0.4?
    PowerBook G4   Mac OS X (10.3.9)  

    Hi Rodney
    Welcome to Apple Discussions
    This sounds like one of those "oddities", contributed to by a few sources.
    I can clear the Safari cache files as a temporary solution, but I encounter the same difficulties with the “problematic” files once they have been opened again.
    Wondering if you disabled the Safari Cache would the refresh function work correctly? As a test you can disable the Safari Cache by Emptying the Cache first via the Safari menu, then Quit Safari. Now go to the Finder>Your User Library>Caches>Safari. Single click on the Safari folder, then Apple Key + I to open Info panel. There, check the "locked" box. This prevents further additions to the cache. The downside, you lose your ability to upload images etc. within Safari (my cache is disabled, so I use Firefox for the uploads).
    Then restart Safari. Try the PDF from within Safari.
    Post back

  • How to upload pdf files to icloud using a pc

    While using MobileMe and Idisk on my pc was extremely easy, turning to iCloud seems to be more cahotic. i.e. I cannot upload PDF file from my pc to iCloud. Any suggestion?
    Thanks 

    Hi Ajay,
    Using FILE_UPLOAD UI element you can upload files..
    Please check this..
    http://help.sap.com/saphelp_ERP2005/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm
    http://wiki.sdn.sap.com/wiki/display/WDABAP/ExcelFileUploadAndDisplayDataUsingWebDynPro+ABAP
    Upload PDF file to Webdynpro
    Cheers,
    Kris.

  • Since I downloaded Adobe Reader 11.0.07 I have been totally unable to print any PDF files using my Dell 1720 laser printer - I just get a blinking "error" light on the printer, no other error messages . I never had a problem printing PDF files before down

    Since I downloaded Adobe Reader 11.0.07 I have been totally unable to print any PDF files using my Dell 1720 laser printer - I just get a blinking "error" light on the printer, no other error messages . I never had a problem printing PDF files before downloading the new Reader version. Suggestions? Thank you.

    Hi,
    Which version of Adobe Reader were you using earlier when printing using Dell printed was working fine?
    Thanks,
    Shakti K

  • How to batch upload PDF files into database BLOB

    Hello.
    I have a requirement to batch upload PDF files into BLOB column of an Oracle 8.1.7 table from Forms 6i Web. The content of the blob column (ie. the PDF content) MUST be displayable from all client software (eg. Oracle Web forms, HTML forms, etc.)
    Our environment is
    Middle-tier is 9iAS on Windows/2000
    Database is Oracle 8.1.7.0.0 on VMS
    Oracle Web Forms 6i Patch 10
    Basically my Oracle web form program will display a list of PDF files to upload and then the user can click on the &lt;Upload&gt; button to do the batch upload. I have experimented the following approaches but with no luck.
    1. READ_IMAGE_FILE forms built-in = does NOT work because it cannot read PDF file. I got error FRM-47100: Cannot read image file
    2. OCX and OLE form item = cannot use this because it does NOT work on the Web. I got error FRM-41344 OLE object not defined
    3. I cannot use DBMS_LOB to do the load because the PDF files are not in the database machine.
    4. Metalink Note 1682771.1 (How to upload binary documents back to database blob column from forms). When I used this, I got ORA-6502 during the hextoraw conversion. In using this solution, I have downloaded a bin2hex.exe from the Google site. I've noticed that when I looked at the converted HEX file, each line has the character : (colon) at the beginning of each line. I know the PDF file has been converted correctly to HEX format because when I convert the HEX file back to BIN format using hex2bin.exe, I'm able to display the converted bin file in Acrobat Reader. When I removed the : (colon) in the HEX file, I did NOT get the ORA-6502 error but I CANNOT display the file in Acrobat Reader. It gives an error "corrupted file".
    5. upload facility in PL/SQL Web toolkit - I tried to automatically submit the html form (with htp.p) but it does NOT load the contents of the file. I called the URL from Oracle forms using web.show_document. There seems to be issues with Oracle Web forms (JInitiator) and HTML (+ htp.p).
    The other options I can think of at this point are:
    1. Use SQL*Loader to do the batch upload via SQL*Net connection and use HOST() built-in from Oracle Webforms to execute SQL*Loader from the 9iAS.
    2. Write a Visual Basic program that reads a binary file and output the contents of the file into a byte array. Then build a DLL that can be called from Oracle webforms 6i via ORA_FFI. I don't prefer this because it means the solution will only work for Windows.
    3. Write a JSP program that streams the PDF file and insert the contents of the PDF file into blob column via JDBC. Call JSP from forms using web.show_document. With this I have to do another connection to the database when I load the file.
    4. Maybe I can use dbms_lob by using network file system (NFS) between the application server and VMS. But this will be network resource hungry as far as I know because the network connection has to be kept open.
    Please advise. Thank you.
    Regards,
    Armando

    I have downloaded a bin2hex.exe from the Google site.
    ... each line has the character : (colon) at the
    beginning of each line. I'm afraid it isn't a correct utility. I hope you'll find the source code of a correct one at metalink forum:
    Doc ID: 368771.996
    Type: Forum
    Subject: Uploading Binary Files: bin2hex and hex2bin do not reproduce the same file
    There is some links to metalink notes and some example about working with BLOB at http://www.tigralen.spb.ru/oracle/blob/index.htm. Maybe it helps. Sorry for my English. If there is any problem with code provided there, let me know by e-mail.

Maybe you are looking for

  • Remote and testing server set up

    I want to upload to the server some php pages containing a registration form, log in, and membership directory. I am able to get everything working ON MY COMPUTER (not shouting - just for emphasis) using wamp server. I am completely confused about ho

  • Time Machine no longer recognizes backup

    I have been using Time Machine to backup to a Time Capsule for a few years with no problem. Yesterday, I realized that the Time Machine menu in the menubar had an alert icon in it. I clicked on the menu and was told the last update was three days pre

  • How to create a dynamic screen (play with containers !) ?

    Hello, Here is the screen I want to do (one splitter with two containers) : |                                |    | button 1 |          | button 2 |              |________________________________________ |                                             

  • SOAP (async) to Idoc with BPM

    Hello All, I have scenario SOAP to IDoc. I need to use BPM to send email in case PI was not able to send data to ECC. Can someone please help with the steps required for BPM. I am very much confused. Thanks,

  • How to pass a data set as a filter?

    Hello everybody! Are asking me to do the following: Select from a Combo Box classifications suppliers and all suppliers to pass on the whole as a result of a query filter. At this time I was only able to pass the values of the first, someone will hav