How to save HTML file with images present in the server to local machine

Hi all
In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.
The code i am using is below :-
l
                    File fname = new File(filePath);
                    if(!fname.exists())                return;
                    FileInputStream istr = null;
                    OutputStream ostr = null;
                    response.setContentType("application/"+format);
                    response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
                    try { 
                         istr = new FileInputStream(fname);
                         ostr = response.getOutputStream();
                         int curByte=-1;
                         while( (curByte=istr.read()) !=-1)
                              ostr.write(curByte);
                         ostr.flush();
Can anyone suggest what i need to do
regards

The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.

Similar Messages

  • How to send HTML mail with images multipart/related message

    Hi,
    Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
    Thanks

    Hi,
    Could any body tell me how to send HTML mail with
    ith images in "multipart/related" message,if any body
    can give the code ,it would be helpful.
    ThanksHi!
    Refer to
    http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
    I've found it very helpful.
    Look at the last part for a code showing how to send HTML mail!
    Regards

  • How to display html content with image in Adobe Flash and Flex mobile project?

    Hi,
      I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?

    Hello,
    The only current way is to use an iFrame, or if you only need some html tags you could use the Text Layout Framework.
    Here this is the iFrame approach:
    http://code.google.com/p/flex-iframe/
    If the swc do not work in Flex4 just use its ource code which works...
    ...it is basically based on this:
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    see also and vote, please:
    http://bugs.adobe.com/jira/browse/SDK-12291
    http://bugs.adobe.com/jira/browse/SDK-13740
    Regards
    Marc

  • How to save PDF file with predefined name?

    Hi,
    I am new in LiveCycle Designer. I have a requirement to save a PDF file with predefined file name. When user clicks a "Save as PDF" button, the fillable form is saved with the name from the form fields (e.g. FormID_UserID_Timesstamp...)
    I added a button (btnSavePDF) to the form (Control Type=Regular). Then I added an action with the Condition:"When button is clicked" and the Result: "Save the form". I got the JavaScripts it genreated:
      CoverPageForm.FormPage.btnSavePDF::click - (JavaScript, client)
    app.execMenuItem("SaveAs");
    When I tested it in Adobe Acorbat XI, I have option to save it as .pdf or other file formats. My questions is how can I save it with the predefined file name as a .pdf file, instead user has option to change the file name or change the file format? Can app.execMemuItem() method take other parameters?
    Thanks
    Sam

    You can't do it with app.execMenuItem. You can use the doc.saveAs method, but it has to be executed in a privileged context. For your application this means a folder-level JavaScript file that would have to be installed on each user's machine or with code in a certified PDF that the users chooses to trust to allow for privileged JavaScript execution.
    More information on the saveAs JavaScript method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.524.html
    and some sample code relevant to the folder-level JavaScript option: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.168.html
    All of the sample code shown is for a regular PDF, so you'll have to adjust slightly for using with an XFA.

  • How to handle flat file with variable delimiters in the file sender adapter

    Hi friends,
    I have some flat files in the ftp server and hope to poll them into XI, but before processing in XI, I hope to do some content conversion in the file sender adapter, according to the general solution, I just need to specify the field names, field seperator, end seperator, etc. But the questions is:
    The fileds in the test data may have different amount of delimiters (,), for example:
    ORD01,,,Z4XS,6100001746,,,,,2,1
    OBJ01,,,,,,,,,,4,3     
    Some fileds only have 1 ',' as the delimiter, but some of them have multiple ','.
    How can I handle it in the content conversion?
    Regards,
    Bean

    Hi Bing,
    Plz do refer the following blogs u will get an idea:
    File content conversion Blogs
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    Regards,
    Vinod.

  • How to save a file with smart object?

    I have just created a file from LR2, by choosing 'open as smart object' in PS.
    I then added a cloning layer and did my cloning.
    When I wanted to save the file, instead of PS turning it in into a PSD with the same name, I now suddenly got the 'save as' pop up screen and '-2' as the recommended name. The original folder where the file came from was not shown.
    I don't know what that's all about, but I'd prefer it would just save the file as a PSD and automatically show the file alongside the NEF in LR2, like it does when I don't use the 'open as smart object' feature. Is this typical for working with smart objects opened straight from LR2?
    Any help will be greatly appreciated.
    Marsel

    Well, like this you open the file s a smart object, so if you want to now clone on a layer but want it to be a part of the smart object then you go to the layer panel and click on the smart object's icon there to edit the smart object and you hit save (command S) and it will save with that layer to your original.
    then when you click the tab or the window that has the original opened as smart object those changes will be reflected, but you will not see your cloned layer active as that is a part of the smart object and you have to open the smart object to get to it.
    What you say! Yes that is what I say that is what a smart object is, you are using the smart object as a part of another document( that is why you are being asked to save as, as this new documents you can now make changes which will not effect the original which is the smart object unless you rasterize it which will make it no longer a smart object.
    What good is a smart object, well there are many say you are using this document or image if you wish in say five projects and the image has been retouched and it is determined it should have some more work done to it all you have to do is retouch the smart object and all five projects are updated.
    You see smart.
    And of course you can d things to all five projects that can be different from one another on other layers without ever destroying the work you have done to the smart object.

  • How to Display Html Text with Image

    HI Frens,
    I am getting some html text from a source, Later i want to
    display that data, but it may happened that it has some images in
    it. Currently I am using text area to display it.
    Now My question is if there is any image will it show, as we
    can see it in our mails? if Not, Which component I should use for
    this?
    I also want that I need to select some file from, How can i
    get open dialog box here?
    Thks in Advance for replies frens:
    Ashish Mishra

    Hi Ashish,
    If I have understood your requirement properly, u want to
    display html text on a flex application.
    I think there its better if you use the html component to
    display the text. I have a sample code which will give you a
    direction to think on.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="initApp( )">
    <mx:Script>
    <![CDATA[
    public function initApp( ):void
    var initHtml:String = "<html><head> \
    <title='Page Example'/> \
    <body bgcolor='#ccddee'><h1>Page
    Example</h1> \
    <p>This is a complete <b>HTML</b> \
    page as a
    <em>string</em>.</p></html></body>";
    this.html.htmlText = initHtml;
    ]]>
    </mx:Script>
    <mx:HTML id="html" width="100%" height="100%" />
    </mx:Application>
    Also do you want a file open dialog box??

  • How to save a file with tiling

    I have a completed artboard that I need to be tiled into nine 11"x17" sheets. How do I tile the board and how do I save the file so that when I take it to get it printed (i.e. Office Max, Fed Ex) it will print individually?

    Here's one way. Make a new document at 33x51. In the print dialog, set the page size in the page setup to 11x17 and check tile. It should show up like the lower left. When you go back to AI, your page should look like the second picture. Of course there is no allowance for overlap so you will have to fiddle a little.

  • How to send HTML email with variable substitution in the email body section?

    Does anyone have some scripting examples that create a HTML formatted e-mail with the ability to have some fields be variables?
    I'm familiar with updating a XML document using a template file and the "keyword transform" function in the script.
    (Like setting an emergency close for a queue for example)
    I've also successfully written a script that sends an e-mail with a .wav file attachment.  I think I have the basics down on the e-mail part.
    Using the keyword transform gives me an xml document that shows the tags as well as the desired variable.  Functional but not very attractive
    The issue I'm really struggling with is the formatting of the e-mail body.
    Is there a way to have a "prettier" document with some basic HTML tags that allow the same function?
    For example I'd like a sentence in the body of the e-mail to say
    "Call received from number <VariableOfCallingNumber>  at <TimeVariable>
    I can do this in the subject easily enough but adding together some strings and variables. 
    I could do the same thing in the e-mail body DOC[], but as I understand it, I could only get 1 line so it would be pretty limited
    Can anyone point me in the correct direction?
    Thanks !!

    sorry, not possible
    http://stackoverflow.com/questions/5620324/mailto-with-html-body
    https://www.google.com/search?rlz=1C1CHFX_enUS566US566&{google:acceptedSuggestion}oq=mailto+with+mime+type&sourceid=chro…

  • How to import csv file with multiple tables into sql server

    I have multiple csv files that has one sheet but has 130 headers with each header having different data. 
    I'd like to import each one of these header rows with data into its own file in sql server. 
    I know very basic SSIS and am but am not familiar with the scripting in it though which what I assume I'd have to use. 
    Each header in the csv file is structured as such(also see example pic):
    first header would be this:                             
          ITEM = ORG_V                              
          DATE = 2013-07-22 10:00 ~ 2013-07-22 10:15      
    column names
    data
    second header would be this:
    ITEM = TER_V
          DATE = 2013-07-22 10:00 ~ 2013-07-22 10:15
    column names
    data
    The headers can be at any random row number as well as the data size in each excel file differs but they all start with "ITEM ="
    and then in the next row "DATE ="
    I could also convert these to excel files if it makes this process easier. 

    Why don't you put a filter on D3, filter out the blanks, copy/paste to a new CSV file, save it, and import it.
    There's no way you're going to get SQL to do that kind of thing for you.  The language is for set based operations, not for complex data manipulation tasks.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to upload html file to email

    Hi,
    I have absolutely no html background but was able to come up with a single page layout with graphics, texts and links with the help of online tutorials using Adobe Go Live which I can open the file now in Dreamweaver.
    My goal is not to come up with a webpage in cyberspace but to create an html file with images and links to specific websites that can be emailed to people. The file must be part of the email body that people can readily view the images, texts and click the links right away and not to be as an attachment.
    Would appreciate it very much if someone can help me out.
    Thanks.
    Newbie

    The simplest way to handle this would be to Upload the  page and files to a  remote server space and send your email buddies a link to the site.   Barring that....
    How to Code HTML Emails
    http://www.sitepoint.com/article/code-html-email-newsletters/
    Use  inline CSS styles for fonts and background colors.  Use Tables to hold your  page elements.  Use absolute URLs to images hosted on your web server because attached images may not get through. Give  people who can't see your HTML page in their email client a link to the HTML  page on your web server.
    Download some HTML Email Templates from the links below  to help you get started.
    Mail Chimp
    http://www.mailchimp.com/resources/html_email_templates/
    Constant  Contact
    http://www.constantcontact.com/email-marketing/html-email-templates/index.jsp
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How to upload html file document with his.files

    i can upload only one file and i can't upload html file with his images or some more pages
    index.html
    chapter1.html
    chapterN.html
    I see this problem so: upload zip file and extract to os(i use linux) and saved link to his index.html.
    IS IT POSSIBLE.
    Thanks.
    Sorry for my english.

    The simplest way to handle this would be to Upload the  page and files to a  remote server space and send your email buddies a link to the site.   Barring that....
    How to Code HTML Emails
    http://www.sitepoint.com/article/code-html-email-newsletters/
    Use  inline CSS styles for fonts and background colors.  Use Tables to hold your  page elements.  Use absolute URLs to images hosted on your web server because attached images may not get through. Give  people who can't see your HTML page in their email client a link to the HTML  page on your web server.
    Download some HTML Email Templates from the links below  to help you get started.
    Mail Chimp
    http://www.mailchimp.com/resources/html_email_templates/
    Constant  Contact
    http://www.constantcontact.com/email-marketing/html-email-templates/index.jsp
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How do i make a still image (photo) fit the length of the music? I record music and want to put the tracks to a video file with a still image of my business logo in the background. Any help?

    How do I make a still image (photo) fit the length of the music? I record music and want to convert the tracks to a video file with a still image of my business logo in the background. On windows movie maker you could just select "fit to music" but this program isnt as easy to figure out! Any help?

    Double-click on the still image in the project timeline to open the Inspector. In the Inspector, adjust the duration by typing in a new duration to match the length of your music. I think the limit for a still image is 10 minutes. If you need more than this, simply drag the image into the timeline again then adjust its duration. The two images will play seamlessly (no gap will be visible).
    See this iMovie Help topic:
    http://help.apple.com/imovie/#mov3a883915
    You can achieve more precision when entering durations by changing a preference in the menu item iMovie Preferences. Check (tick) the preference for Show Time As HH:MM:SS:frames. This will enable you to enter the duration of stills down to the frame level, rather than full seconds (NTSC is 30 frames per second; PAL is 25 fps). When entering times, type a colon between each time segment, such as 2:50:15, which represents 2 minutes 50 seconds and 15 frames. For 5 seconds 20 frames you would enter 5:20 and so forth.
    Note that the music will only run to the length of the video in the timeline (in your case, the still images). So, after increasing the stills duration you will need to drag the end of the music track as far as required. The stills can be dragged inwards to reduce the duration if necessary.
    John
    Message was edited by: John Cogdell - added Note

  • There is no 'Save as' under the file menu.  How do I save a file with another name?

    Numbers help refers to the 'Save As' function in the File menu.  My version (latest) does not have a 'Save As' function.  How do I save a file with another name?

    Ross Millard wrote:
    Badunit. You have an original file and an edited file. Now you duplicate the edited file and save it with a different name. Now do you have to go and delete the changed file from which the duplicate had been made? And.... is the original still unchaned... still original?
    Ross,
    For the situation you describe, Apple has provided Duplicate and Revert. Use File > Duplicate to reach this menu:
    Regards,
    Jerry

  • How to save a file in Jfilechooser with extension

    hi all
    i'm trying to save a file with a certain extension
    i have my class that extends FileFilter, and which write into the jfilechooser combo box with extensions. .jar
    how can i save a file with this extension?
    here is the code
    JFileChooser fileChooser = new JFileChooser();
              fileChooser.addChoosableFileFilter(new JarFilter());
              int returnVal = fileChooser.showDialog(new JFrame(), "Export");
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                   File file = fileChooser.getSelectedFile();
                   try {
                        JarExporter exporter=new JarExporter(this.generateXMLString(file.getName().replaceAll(".jar", "")),
                                       this.editor.getLinkageCanvas().getSelectedWidgetIDs());
                        exporter.exportJarFile(file);
                   } catch (Exception exception) {
                        System.out.println("Export error.");
              }

    hi all
    i'm trying to save a file with a certain extension
    i have my class that extends FileFilter, and which write into the jfilechooser combo box with extensions. .jar
    how can i save a file with this extension?
    here is the code
    JFileChooser fileChooser = new JFileChooser();
              fileChooser.addChoosableFileFilter(new JarFilter());
              int returnVal = fileChooser.showDialog(new JFrame(), "Export");
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                   File file = fileChooser.getSelectedFile();
                   try {
                        JarExporter exporter=new JarExporter(this.generateXMLString(file.getName().replaceAll(".jar", "")),
                                       this.editor.getLinkageCanvas().getSelectedWidgetIDs());
                        exporter.exportJarFile(file);
                   } catch (Exception exception) {
                        System.out.println("Export error.");
              }

Maybe you are looking for

  • How to use facetime with same apple id

    If I've already downloaded facetime on my imac do I have to buy it again for my mac book which is older and didn't come with facetime? And also, my husband has taken our ipad to Asia and I wanted to facetime with him using my imac at home, however I

  • How to check if a file system in global zone is shared on zones

    Hello, Would you by any chance know how to detect if a file system in the global zone is shared with any zones created from the global zone (either shared with readonly or read-write)? Thanks in advance. Regards Frank

  • Issue with std GET method GET_PROPERTY_AS_VALUE

    Hi, We have created a Z field using AET in WebUI which is already moved to Production system. This field has a Get and Set method customized to populate its value. Now we have included  similar field with a similar logic. The issue is that now the ea

  • No rows returned in the BIS views

    I am new to Discoverer. I had connected to Financials Intelligence responsibility using discoverer desktop. When I tried to create a workbook in General Ledger Business Area to display the GL accounts, I get no rows returned message. I get the same m

  • Body missing in recievr Communication channel payload

    hi all. i have done a  file to file scenario and when i tested it its working fine the message is showing in greencolour in sxmb_moni but when i look at reciever channel message(payload) its showing only header and trailer but no body (i can see the