Send html and  image data to browser

Hi,
Is it possible to send both html and image data to browser.
Can I dynamically generate the image and send the image data without storing the image in web server's hard disk.
Can you plz tell me what areas that I should look for and learn in order to do this.
THanks a lot,
Chamal.

u can make use of jakarta`s commons fileUploader classes to upload ur file to the server
here is a small example i made
html is like this
<html>
<form method="post" action="/uploadFile" enctype="multipart/form-data">
<input type="text" name="uname"/>
File
<input type="file" name="upfile"/>
<input type="submit"/>
</form>
</html>
my servlet contains these code
FileUpload fup=new FileUpload();
          boolean isMultipart = FileUpload.isMultipartContent(req);
//          Create a new file upload handler
          System.out.println(isMultipart);
          DiskFileUpload upload = new DiskFileUpload();
//          Parse the request
          List /* FileItem */ items = upload.parseRequest(req);
          Iterator iter = items.iterator();
          while (iter.hasNext()) {
          FileItem item = (FileItem) iter.next();
          if (item.isFormField()) {
          System.out.println("its a field");
          } else {
          System.out.println("its a file");
          System.out.println(item.getName());
          File cfile=new File(item.getName());
          System.out.println(cfile.getName());
          System.out.println(getServletContext().getRealPath("/mine"));
          File tosave=new File(getServletContext().getRealPath("/"),cfile.getName());
          item.write(tosave);
for more info
http://sun.calstatela.edu/~cysun/documentation/jakarta/commons/fileupload-1.0/apidocs/org/apache/commons/fileupload/FileItem.html

Similar Messages

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)

    Dear Experts,
    i am getting the below error when i was giving * (Star) to view all the items in DB
    [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)
    As i was searching individually it is working fine
    can any one help me how to find this..
    Regards,
    Meghanath.S

    Dear Nithi Anandham,
    i am not having any query while finding all the items in item master data i am giving find mode and in item code i was trying to type *(Star) and enter while typing enter the above issue i was facing..
    Regards,
    Meghanath

  • Error in SQL Query The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query

    hi Experts,
    while running SQL Query i am getting an error as
    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    T2.LineText
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,T2.LineText
    how to resolve the issue

    Dear Meghanath,
    Please use the following query, Hope your purpose will serve.
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    CAST(T2.LineText as nvarchar (MAX))[LineText]
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,CAST(T2.LineText as nvarchar (MAX))
    Regards,
    Amit

  • Can't select text when export in HTML and Images

    I am entirely new to Fireworks and I can't find anyone to teach me Adobe Fireworks. I followed some youtube tutorials but most of them are vague. I am still figuring the way to export from Fireworks to Dreamweaver, without affecting its contents like bitmap images and the text. When I export in HTML and Images format and opened the htm file, I can't select the text I've inserted in Fireworks. Can anyone tell me what I should do?

    I cant scroll below or above viewable section of text in any of my Macbooks, iMac, Mac Mini. Never have been able to, never could, except by pressing the arrow keys whilst selecting, to move up or down.
    Its stupid
    I dont have flash installed (never will do since my first virus of video ad sound running in background from Cnet was downloaded and kept returning until i deinstalled flash).
    I believe that this is a universal issue because none of my Macs can scroll out of screen when selecting text, which as a webmaster and developer, is a pain in the butt
    My issue is not in word documents, its in everything

  • Can I generate html and images from the same script?

    I am trying to create a script that generates both html and gif images. Is there a way using the multipart mime content type to create a single stream that includes both html and images?

    No. Facing pages has been removed from Pages 5 along with 100 other features.
    If you want to view two parts of the same document you will need to rename a copy and place two windows side by side, which is hampered by Pages 5's bloated use of screen real estate.
    Peter

  • Sending Text and Images

    HI,
    In my MIDlet I have stored some text and and an image in the RMS and I was just wondering if it was possible to send that information by email or mms (obviously by reading the RMS and converting it back to a string or image) to an email account or would it be better to send it to a web server?
    Thanks,
    Tom

    Hi,
    Yup ... it would be better to send the Image data and text to a webserver and generate your emails etc from there.
    regards

  • Html and Images on Email

    MydeviceisBBCurve8330Verizon,andIthinkit'sgreat.Bu​tIneedhelp.
    I have BB Smart app and it helps with emails. However, I had some Emails come thru with how they would look as they came thru on my PC.  I would have to press menu (on my Device) and click on get Images, and full color photos would apprear. How do I get my email to show the HTML and photos like it was.
    Thanks,
    Writer~

    I don't recommend using BBSmart with OS 4.5 and the built in HTML support.  I would recommend removing BBSmart.  However, with the built in HTML you will still need to click "Get Images."
    1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
    2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you!

  • Inserted HTML and Images

    Is it possible when inserting html in Muse, to have images within the html text? If we will be using Adobe Catalyst, what will I need to do to properly code the images into the text?

    Hello,
    You can use the <img> tag between the text. More info on : http://www.w3schools.com/tags/tag_img.asp
    In place of Image Path, use "/Assets/Filename.extension" (replace filename.extension with the filename of the image).
    After that use File>Add files for upload and select the image so that it gets added to Assets folder when you Publish the site.
    You might not be able to preview it but you can use File>Export as HTML and view the whole site exported in a local folder.
    Regards,
    Sachin

  • Sending HTML + related images + attachments

    Hello,
    I want to send an HTML file + related images + attachments.
    I actually succeeds in sending HTML content + related images.
    I also know how to attach files in a mail.
    But when I want to have both of those functionnalities in the same mail, I miserably fail... ;)
    Does anyone have a simple example that sends an HTML file + related images + attachments??
    HELP!!!!
    Denis.

    USe this as a **guide**.
    Its sends images + altText(similar to attachment, except that its embedded + html)
    public static void sendC()throws Exception{
              String host = "xx";
              String from = "xxx";
              String to = "xxx";
              String file = "logo.gif";
              Properties props = System.getProperties();
              props.put("mail.smtp.host", host);
              Session session = Session.getDefaultInstance(props, null);
              Message message = new MimeMessage(session);
              message.setSubject("Embedded Image");
              message.setFrom(new InternetAddress(from));
              message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
              MimeMultipart multipart1 =new MimeMultipart("related");
              //multipart1.setSubType("alternative");
              MimeMultipart multipartBody = new MimeMultipart("alternative");
              MimeBodyPart part=new MimeBodyPart();
              part.setContent("textMessage","text/plain");
              multipartBody.addBodyPart(part);
              part=new MimeBodyPart();
              String htmlText = "<H1>Hello</H1>" +"<img src=\"cid:memememe\">";
              part.setContent(htmlText,"text/html");
              multipartBody.addBodyPart(part);
              MimeBodyPart mbpBody = new MimeBodyPart();
              mbpBody.setContent(multipartBody);
              multipart1.addBodyPart(mbpBody);
              MimeBodyPart imagePart = new MimeBodyPart();
              DataSource fds = new FileDataSource(file);
              imagePart.setDataHandler(new DataHandler(fds));
              imagePart.setHeader("Content-ID","<"+"memememe"+">");
              imagePart.setDisposition("inline");
              multipart1.addBodyPart(imagePart);
              message.setContent(multipart1);
              Transport.send(message);
    You will have to make modifications so that the attchmetns are not embedded.

  • Send email with html and images over Sockets

    Hi! I'm sending email messages through sockets with html. So far is working great. But now, I need to include images in the html code, like a web page. I don't have any idea on how to do this. Sending image apart from the html code is not big deal, but how to put it in the code. I mean how to make this html code, work:
    <table border="0">
         <tr>
              <td>Image in code</td>
         </tr>
         <tr>
              <img src="what to put here"/>
         </tr>
    </table>This is the code that I'm using to send the html mail:
    StringBuffer retBuff = new StringBuffer();
              //BufferedReader msg;
              //msg = new BufferedReader(msgFileReader);
              smtpPipe = new Socket(mailHost, SMTP_PORT);
              smtpPipe.setSoTimeout(120000);
              if (smtpPipe == null) {
                   return retBuff;
              inn = smtpPipe.getInputStream();
              outt = smtpPipe.getOutputStream();
              in = new BufferedReader(new InputStreamReader(inn));
              out = new PrintWriter(new OutputStreamWriter(outt), true);
              if (inn == null || outt == null) {
                   retBuff.append("Failed to open streams to socket.");
                   return retBuff;
              String initialID = in.readLine();
              retBuff.append(initialID);
              retBuff.append("HELO " + localhost.getHostName());
              out.println("HELO " + localhost.getHostName());
              String welcome = in.readLine();
              retBuff.append(welcome);
              retBuff.append("MAIL From:<" + from + ">");
              out.println("MAIL From:<" + from + ">");
              String senderOK = in.readLine();
              retBuff.append(senderOK);
              for (int i = 0; i < to.length; i++) {
                   retBuff.append("RCPT TO:<" + to[i] + ">");
                   out.println("RCPT TO:<" + to[i] + ">");
                   String recipientOK = in.readLine();
                   retBuff.append(recipientOK);
              retBuff.append("DATA");
              out.println("DATA");
              out.println("From: Steren <" + from + ">");
              out.println("Subject: " + subject);
              out.println("Mime-Version: 1.0;");
              out.println("Content-Type: text/html; charset=\"ISO-8859-1\";");
              //out.println("Content-Type: multipart/mixed; charset=\"ISO-8859-1\";");
              //out.println("Content-Transfer-Encoding: 7bit;");
              //String line;
              //while ((line = msg.readLine()) != null) {
              //     out.println(line);
              out.println(msg);
              retBuff.append(".");
              out.println(".");
              String acceptedOK = in.readLine();
              retBuff.append(acceptedOK);
              retBuff.append("QUIT");
              out.println("QUIT");
              return retBuff;

    Throw all this away and use one of the numerous existing Java mail packages, such as javax.mail for a start.

  • How to make muse export to html and image/asset files only without css and jquery?

    Hi there adobe community,
    I am here today to see if there is a way of only exporting a muse site as html with the css integrated in like dreamweaver does. Therer probably is no way to do this. However, i dont want external .css files and .js files i want them all in the html file, is there a way to do this. The reason i want to know is because my client wants no external files and only wants an image and html documents. I told him that it might not be possible and i want to know if it is. If you could help me that would be great.
    Thankyou For Your Time.

    Hi Pink,
    When Muse exports as HTML , It exports everything separately like the HTML files , .Css files in a different folder and the .js files in a different folder. There is no way in Muse that you can export in any other way.
    This is because a lot of the Css properties are used all across the site and not only on a particular page and so these properties are shared.
    Moreover this is a much more efficient way of designing a website rather than keeping everything in  a single file.
    Regards,
    Rohit Nair

  • JEditorPane, HTML, and image

    I need help to display images into an JEditorPane that show a String rapresent the an HTML page.
    can anyone help me?

    I'm making more investigation in this issue and what I can see is that jEditorPane doesn't care about the <div style="width:348px; ">
    that I put in the html code, can anyone give me and idea?
    thanks for reading

  • Sending commands and reading data - RS232

    Hello guys !
    I have a special problem communicatin through RS232 with a PIC microcontroller.
    The problem :
    On push of a button i want to read a value from the microcontroller.
    On another push of a button, i want to write a value to the microcontroller.
    However, i get an error : "VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed."
    I've tried to search the forum for similar problem, but i haven't found a suitable answer.
    I also post my current code for reference. I'm using LabView 8.5.1.
    The RS232 communication is working fine (i can read and write from the PIC).
    I tested the connection extensively so i think that te problem is not there.
    Can u help me ?
    Thank you !
    Attachments:
    Serial-1.vi ‏53 KB

    Are you waiting for a response from the device after you send it a command? Are you getting any data back? A simple delay is not a very good solution since your program may work for one given situation but the hard delay may not in others. You can use a VISA event to wait for data at the serial port. How much data are you expecting? If it is a larg eamount of data you may want to calculate the timeout for the read based on the amount of data and your given BAUD rate. If you expect a large amount of data you may not have your timeout set long enough for all the data to arrive, especially if you are using slower BAUD rates.
    I noticed in your code that you have enabled the read to look for a termination character. Does your device send one? If not, you may be getting the error because you have not received the 1000 bytes you indicating you want to receive. If you will not be getting a termination character and you don't know how much data you will be receiving you need to create some type of algorithm to read data and decide when to stop. Th eapproach I use is to read a single byte. This read will contain the maximum timeout to wait for the data to arrive. Once a single byte has been read I continue reading chunks of data using a small timeout value. This value should be long enough to allow any small delay that occurs in the data as it is being sent from the device but short enough to indicate the data is complete once a timeout does occur. This timeout error is discarded since it is not a true communication error.
    NOTE: You should avoid using controls as variables. You have your Byte to Read controls set as default values and hidden. Therefore they are nothing more then a constant. Hiding controls simple to hide "variables" is not a good coding practice. Either expose the controls to teh user or use a constant.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Issues with AR Invoice form after sending barcode and tab data to PC

    Hi,
    We have a barcode system to scan ItemCodes and send 5 x tabs 'keypresses' to the checkout users PC.
    This basically populates all the required fields on the AR Invoice row and jumps down to the next row ready for the next barcode.
    We have recently upgrading to 8.8, and we have developed an annoying issue.  Intermittently, the PCs not behaving as expected.  Here are some of the bad results we have experienced:
    1. The barcode scan is done, but the tabs being sent to the PC are not registered..  The PC just sits there with the cursor at the end of the (populated) ItemCode box without recognising that tabs have been sent
    2. The barcode scan is done and the ItemCode box is populated as expected.  However SAP has not processed all the expected tabs and the cursor remains one of the next few fields awaiting user input.
    3. As above the barcode scan is done and the ItemCode box is populated as expected.  However SAP has not processed all the expected tabs.  Also, the cursor is not present within the current 'selected' field - it seems to have almost lost focus from the fields on the form.  Note: the SAP window remains the active Window.
    All of this means that the processing of Invoices is being delayed as tabs are not being processing and form focus is being lost.
    The form settings are correct as they are unchanged from being working to suddenly stopping working.  The issue is occasionally resolved by a reboot of the client PC in question. 
    Is this a known issue in 8.8?  If not, is this most likely to be caused by display issues or SAP 8.8 not being able to handle the receipt of tab commands in such quick sucession?
    Any pointers or comments from your experience would be appreciated.
    Regards
    OB

    Which patch level are you using as this should be fixxed. I would also look if there are any conflicts with the add-ons as there some major changes in the SDK.

  • Why does fireworks add and extra quote on exporting html and images... looks like this -----  align=""left"

    Hi Adobe Community,
    I had this issue on previous versions of Fireworks.
    Why is it happening? Is there a glitch in the software? I thought it would be fixed in the CC version..
    here is a snippet of code that is exported.
      <td><table style="display: inline-table;" align=""left" border="0" cellpadding="0" cellspacing="0" width="810">
    Basically where ever there is a align="left" it is exported as align=""left"
    This leaves me to do a find and replace to fix the code. Kind of annoying.
    Personally I thought this would of been fixed in this version.
    Please advise and how to fix this and prevent it from happening.
    See screenshots below for my fireworks export settings.
    Please help.

    Anyone out there experience this?

Maybe you are looking for