www.webdeveloper.com
Results 1 to 5 of 5

Thread: Change of MIME type

  1. #1
    Join Date
    Apr 2005
    Posts
    6

    Change of MIME type

    Hi

    Im working with a SAP-portal, and articles created in the portal are stored
    as .lpt-files when it acctually is a plain HTML-file.

    I would like to convert those files with PD4ML to PDF-files, but the PD4ML
    doesen't accept the .lpt as an well formed html-page.

    Any idea how to overide the .lpt to get PD4ML to threat the page as an
    html-page.

    If I save the file with the browser "Save As" to a local html-file, and the
    convert the file, theres no problem. But I would like to do all in one step
    for the user, by clicking a "Save As PDF" button on the webpage, and the
    user would be prompt where to save the PDF-file.

    It only has to work with Internet Explorer 6.0 or later.

    Thanks in acvance

    M.Lofberg

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,123
    you can set the content type of a document as follows
    final String CONTENT_TYPE = "text/html";
    response.setContentType(CONTENT_TYPE);

    try this if it doesn't work then you will probably create a temp file change the file extension and then send it to the requesting page
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  3. #3
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Does PD4ML obtain the file by making an HTTP request?
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  4. #4
    Join Date
    Apr 2005
    Posts
    6
    You send in the URL to PD4ML, then PD4ML requests the webpage,
    or you give PD4ML a inputstream to convert.

    M.Lofberg

  5. #5
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    then PD4ML requests the webpage
    If PD4ML cares then the server has to be configured to send that extension as text/html.
    you give PD4ML a inputstream to convert
    Then the content type shouldn't matter there unless the inputstream is the full response from an HTTP request, including the HTTP headers.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles