Trouble sending images over sms

Anyone having trouble sending images over txt messages?

I did it first. You may pay me $10 and get XM2 WebServer 1.2 from my company.
Ok, I'll help ya out here...
HTTP protocol in Internet Explorer is "juiced up" meaning that it does not require HTTP data to be correctly sent. To send an image to be deisplayed...
<html>
<img src="theImage.gif"></img>
</html>
Now, the server will see a GET request like this...
GET /theImage.gif HTTP/1.1
Accepts: Image/jpeg, Image/gif, ...
Your web server (in the IE case just needs to send)...
output.println(data);
The data object is a string, that represents the contents of the image.
To do that, just get the correct File object, connect reader to it, then loop it
until the reader is no longer ready (reader.ready() != true), as it loops, just append
the readLine() command to the end of the data string and it will be ok.
Now this works on IE just fine, using vary small file sizes due to it being loaded directly into
memory. Casing problem if your app has only 500K of memory and the file size is 700K, 500-700=-200K, so use only small file sizes with this method.
There is also the URLConnection and HttpURLConnection classes to use that will do this better, but
they dont have any real way of getting the file's data - that's still YOUR job.

Similar Messages

  • Sending images over network socket

    I'm working on a java web server. So far i have managed to get it to send html documents sucessfully to the client web browser, using a BufferedReader, and a PrintWriter object.
    But how should i send images over the socket? using this method doesn't work. Any suggestions?
    Thanks in advance.
    hornetau

    I did it first. You may pay me $10 and get XM2 WebServer 1.2 from my company.
    Ok, I'll help ya out here...
    HTTP protocol in Internet Explorer is "juiced up" meaning that it does not require HTTP data to be correctly sent. To send an image to be deisplayed...
    <html>
    <img src="theImage.gif"></img>
    </html>
    Now, the server will see a GET request like this...
    GET /theImage.gif HTTP/1.1
    Accepts: Image/jpeg, Image/gif, ...
    Your web server (in the IE case just needs to send)...
    output.println(data);
    The data object is a string, that represents the contents of the image.
    To do that, just get the correct File object, connect reader to it, then loop it
    until the reader is no longer ready (reader.ready() != true), as it loops, just append
    the readLine() command to the end of the data string and it will be ok.
    Now this works on IE just fine, using vary small file sizes due to it being loaded directly into
    memory. Casing problem if your app has only 500K of memory and the file size is 700K, 500-700=-200K, so use only small file sizes with this method.
    There is also the URLConnection and HttpURLConnection classes to use that will do this better, but
    they dont have any real way of getting the file's data - that's still YOUR job.

  • I'm Having Trouble Sending Messages Over IMessage.

    Okay, so I have a 4th generation ipod touch that I'm having trouble sending messages on. It's up to date on 6.0.1. It's also brand new. I only got it 3 days ago, but nevertheless i'm already having problems with imessage not sending messages. The odd thing is it only won't send messages at 12:00/1:00 am- about 10:00 am. The rest of the time I have no problems with it. Also, I should add that I live in an area that does not have high-speed internet but I get it over satillite. So my internet speed is not the best. But I didn't have this problem with my old ipod that I used a day prior to using this one. Any help is greatly appreciated! Thank you.

    iOS: Troubleshooting Messages
    Have you looked at the previous discussions listed on the right side of this page under the heading "More Like This"?

  • Urgent help:send image over network using rmi

    hi all,
    i have few question about send image using rmi.
    1) should i use ByteArrayOutputStream to convert image into byte array before i send over network or just use fileinputstream to convert image into byte array like what i have done as below?
    public class RemoteServerImpl  extends UnicastRemoteObject implements RemoteServer
      public RemoteServerImpl() throws RemoteException
      public byte[] getimage() throws RemoteException
        try{
           // capture the whole screen
           BufferedImage screencapture = new Robot().createScreenCapture(new     Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );
           // Save as JPEG
           File file = new File("screencapture.jpg");
           ImageIO.write(screencapture, "jpg", file);
            byte[] fileByteContent = null;
           fileByteContent = getImageStream("screencapture.jpg");
           return fileByteContent;
        catch(IOException ex)
      public byte[] getImageStream(String fname) // local method
        String fileName = fname;
        FileInputStream fileInputStream = null;
        byte[] fileByteContent = null;
          try
            int count = 0;
            fileInputStream = new FileInputStream(fileName);  // Obtains input bytes from a file.
            fileByteContent = new byte[fileInputStream.available()]; // Assign size to byte array.
            while (fileInputStream.available()>0)   // Correcting file content bytes, and put them into the byte array.
               fileByteContent[count]=(byte)fileInputStream.read();
               count++;
           catch (IOException fnfe)
         return fileByteContent;           
    }2)if what i done is wrong,can somebody give me guide?else if correct ,then how can i rebuild the image from the byte array and put it in a JLable?i now must use FileOuputStream but how?can anyone answer me or simple code?
    thanks in advance..

    Hi! well a had the same problem sending an image trough RMI.. To solve this i just read the image file into a byte Array and send the array to the client, and then the client creates an imegeIcon from the byte Array containing the image.. Below is the example function ton read the file to a byte Array (on the server) and the function to convert it to a an imageIcon (on the client).
    //      Returns the contents of the file in a byte array.
        public static byte[] getBytesFromFile(File file) throws IOException {
            InputStream is = new FileInputStream(file);
            // Get the size of the file
            long length = file.length();
            // You cannot create an array using a long type.
            // It needs to be an int type.
            // Before converting to an int type, check
            // to ensure that file is not larger than Integer.MAX_VALUE.
            if (length > Integer.MAX_VALUE) {
                // File is too large
            // Create the byte array to hold the data
            byte[] bytes = new byte[(int)length];
            // Read in the bytes
            int offset = 0;
            int numRead = 0;
            while (offset < bytes.length
                   && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            // Ensure all the bytes have been read in
            if (offset < bytes.length) {
                throw new IOException("Could not completely read file "+file.getName());
            // Close the input stream and return bytes
            is.close();
            return bytes;
        }to use this function simply use something like this
    public byte[] getImage(){
    byte[] imageData;
              File file = new File("pic.jpg");
              // Change pic.jpg for the name of your file (duh)
              try{
                   imageData = getBytesFromFile(file);
                   // Send to client via RMI
                            return imageData;
              }catch(IOException ioe){
                           // Handle exception
                           return null; // or whatever you want..
    }and then on the client you could call a function like this
    public ImageIcon getImageFromServer(){
         try{
              // get the image from the RMI server
              byte[] imgBytes = myServerObject.getImage();
              // Create an imageIcon from the Array of bytes
              ImageIcon ii = new ImageIcon(imgBytes);
              return ii;
         }catch(Exception e){
              // Handle some error..
              // If yo get here probably something went wrong with the server
              // like File Not Found or something like that..
              e.printStackTrace();
              return null;
    }Hope it helps you..

  • Trouble sending attachments over 5 mb

    Is there a limit in Safari for attachments. I find that I have to use FireFox for sending any one file over around 5 mbs or so.
    For example, I tried sending an Mp3 that was 6.4 mb and I let me computer sit there for 40 minutes and since there is no time meter bar besides the one at the URL screen, which wasn't doing anything, I assumed it was never going to send.
    I sent the exact same file in FireFox and it took about 10 minutes.
    I have verizon DSL 768Kbs download and 128Kbs upload.
    -Brumby

    what we found out was that when we send emails using OBPM to a user, and attach files to those emails, these files get converted into actual messages and therefore the actual message size exceeds.
    Why does OBPM convert file attachments into actual messages? Any reason? Why can't it send it as attachments itself?

  • I've had trouble sending images....then it might take 3 days for them to get there....

    I use GoSMS messaging, and one of the features it has is GoChat.  Since signing up for it although I don't use it, it allows me to send files, pics, using their cloud system I'm not sure on the receiving part.....that would be even better.  They also allow larger images, videos, files to be sent via messenger....If this will help anyone.

    are you connected to wifi? it wont work
    have you tried to delete gosms and see if the stock app works?

  • Trouble sending files over the network.

    I have a network application that corrupts any files that it sends, although the received file is very close (but never exact) to the number of bytes it should be. There is a socket client that each client has, and the Packet data structure is searializable and simply contains a string message and the byte[]. Am I doing something wrong?
    Here is my code for Sending:
    ObjectOutputStream toOtherClient = new ObjectOutputStream(client.getOutputStream());
    ObjectInputStream fromOtherClient = new ObjectInputStream(client.getInputStream());
    Packet fileRequest = (Packet)fromOtherClient.readObject();
    File file = new File(DefaultConfig.defaultFileDirectory+"\\"+fileRequest.getMessage());
    FileInputStream fromDisk = new FileInputStream(file);
    BufferedInputStream fromDiskBuffered = new BufferedInputStream(fromDisk);
    byte[] buffer = new byte[maxPayload];
    while(fromDiskBuffered.available() > 0)
         if (fromDisk.available() > maxPayload)
              fromDiskBuffered.read(buffer);
              toOtherClient.writeObject(new Packet(Packet.Command.File,"",buffer));
         else
              buffer = new byte[fromDiskBuffered.available()];
              fromDiskBuffered.read(buffer);
              toOtherClient.writeObject(new Packet(Packet.Command.File,"",buffer));
    fromDiskBuffered.close();
    fromDisk.close();
    toOtherClient.writeObject(new Packet(Packet.Command.File,"ack"));
    fromOtherClient.close();
    toOtherClient.close();
    client.close();Here is my code for recieving:
    Socket client = new Socket(host, Integer.parseInt(port));
    ObjectOutputStream toOtherClient = new ObjectOutputStream(client.getOutputStream());
    ObjectInputStream fromOtherClient = new ObjectInputStream(client.getInputStream());
    FileOutputStream toDisk = new FileOutputStream(DefaultConfig.defaultFileDirectory+"//"+whatFile); BufferedOutputStream toDiskBuffered = new BufferedOutputStream(toDisk);
    toOtherClient.writeObject(new Packet(Packet.Command.File,whatFile));
    Packet incoming;
    while(true)
         incoming = (Packet)fromOtherClient.readObject();
         if (incoming.getMessage().equals("ack"))
              break;
         byte[] fileData = (byte[])incoming.getData();
         toDiskBuffered.write(fileData);
    toDiskBuffered.flush();
    toDiskBuffered.close();
    toDisk.close();
    fromOtherClient.close();
    toOtherClient.close();
    client.close();

    You're assuming that available() gives you the total length of the file, which it doesn't, and you're ignoring the result returned by the read call, so you're assuming you've read data you may not have read.
    I would rethink the tactic of reading the entire file into a single buffer - this doesn't scale. It's only safe if you know that the file size has an upper bound and that this is relatively low.

  • Trouble sending mail over wireless

    Hi all,
    I'm experiencing a problem sending email (using Mail) since I upgraded the Leopard. The problem happens somewhat randomly, but is extremely annoying. Basically, I can send and receive emails without any problem if I'm connected via ethernet. However, when I'm connected via wifi (in both cases from home), I sometimes get a connection error when I try to send mail. I've set up the same email accounts in Entourage, and sending mail works fine via wireless. This appears to be a Mail issue. Any thoughts?
    Thanks,
    John

    I've been having similar issues since upgrading to Leopard. Mail not sending or receiving, problems with Mail crashing... However, through browsing the forums, I've discovered solutions that have worked for me, and maybe will work for you.
    I have an exchange account, and could send and receive if I were plugged in by ethernet, but not by wireless.
    Several solutions through the threads have come up:
    1. If mail was in your dock before the upgrade, remove it from the dock, and then relaunch it from the applications folder (and keep it on the dock). This largely eliminated the crashing and inability to receive properly.
    2. I checked for the latest firmware update for my router, a Linksys WRT54G V.5. Turns out I didn't have the latest. As soon as I upgraded the firmwarm, sending and receiving by wireless worked like it's supposed to... it just works. It suggests a problem between Leopard and the router that you might want to look into. Of course, wifi send and receive worked fine in Tiger.
    3. I didn't have to add mail as a program with access in the new firewall preference pane. Everything works fine without doing so after the modifications listed above.
    I hope this helps... These aren't my ideas, but what I've found through this discussion forum, so I want to thank those others who have picked out this issue separately. I was only trying to collect my findings here.
    Good luck!

  • Why cant i send images over email ? it worked fine three times and stopped

    i have sent an image to myself as a test from microsoft pictures as an attachment three times and then it stopped

    try turing off imessage in settings login through the app then wait (for say 20 min) connected to wifi so that apple severs can verify and fully activate imessage if this dosent work please reply.

  • TS3276 Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Apple Mail isn't going to change the format of any of your attachments. it isn't going to corrupt them either.
    Exchange is a transport protocol and server. The issue you describe is not related to Exchange.
    There are many different versions of Microsoft Outlook in use and they all have e-mail bugs. Different versions have different bugs. Some Apple Mail hack to get around a bug in Outlook 2003 may cause the same message to be problematic in Outlook 2000. Fix them both and another issue will cause trouble in Outlook 2007. You can't fix this. Apple can't fix this. Microsoft can and has but that is irrelevant if your recipients are using older versions.
    One specific problem is that Apple Mail always sends image attachments inline, as images, not as iconized files. You can change this with Attachment Tamer. Just be aware that use of this software will break other things such as Stationery. E-mail is just a disaster. To date, no one outside of Apple has ever implemented the e-mail standards from 1993. Apple has continually changed its e-mail software to be more compatible with the de-facto standards that Netscape and Microsoft have unilaterally defined and people documented as "standards" after the fact. The e-mail messages that Apple Mail sends are 100% correct and do not violate any of the original standards from 1993 or the Microsoft/Netscape modifications. The problem is entirely bugs and limitations in various versions of Outlook.

  • How do I cancel the distance between the numbers? I'm having trouble copy phone numbers from the phone book and send it via SMS This problem I've found in the Arabic language, numbers appear in reverse Please help System 6.0.1

    How do I cancel the distance between the numbers?
    I'm having trouble copy phone numbers from the phone book and send it via SMS
    This problem I've found in the Arabic language, numbers appear in reverse
    Please help
    System 6.0.1

    MPEG-4 should not be used in FCP unless it is converted first or optimized in the application.
    Trash your preferences. Trash your project render files. Switch off background rendering. Do not re-render. Export your projects.
    Ignore the last frame and first frame indicators.

  • How do I send an Image over a socket ?

    I'm trying to get the output from my webcam and send that data out to a socket. Now the output from the webcam is running I'm just not sure how to send it out over the socket.
    Server.java
    import java.io.*;
    import java.net.*;
    public class Server {
       public static void main(String args[]) {
         ServerSocket serverSocket = null;
         boolean listening = true;
         try {
         serverSocket = new ServerSocket(1354);
         System.out.println("Listening for Connections...");
         } catch (IOException drr) {
         System.out.println("Error Listening :" + drr);
         System.exit(-1);
         try {
         while(listening)
         new ServerThread(serverSocket.accept()).start();
         } catch (IOException er) {
         System.out.println("Error Creating connection:" + er);
         try {
           serverSocket.close();
         } catch (IOException err) {
         System.out.println("Error Closing:" + err);
    }When a connection is made it will start the webcam and send the image.
    ServerThread.java
    import java.net.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    public class ServerThread extends Thread {
        public static Player player = null;
        public CaptureDeviceInfo di = null;
        public MediaLocator ml = null;
        public JButton capture = null;
        public Buffer buf = null;
        public Image img = null;
        public VideoFormat vf = null;
        public BufferToImage btoi = null;
        public ImagePanel imgpanel = null;
        private Socket socket = null;
        Image blah;
        PrintWriter out = null;
        public ServerThread(Socket socket) {
         super("ServerThread");
         this.socket = socket;
        public void run() {
         try {
             out = new PrintWriter(socket.getOutputStream(), true);        
             imgpanel = new ImagePanel();
                 String str1 = "vfw:CompUSA PC Camera:0";
                 String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";
                 di = CaptureDeviceManager.getDevice(str2);
             ml = new MediaLocator("vfw://0");
                try {
               player = Manager.createRealizedPlayer(ml);
                 } catch (Exception npe) {
               System.out.println("Player Exception:" + npe);
                player.start();
             Component comp;
             if ((comp = player.getVisualComponent()) != null) {
               // Grab a frame
               FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
               buf = fgc.grabFrame();
               btoi = new BufferToImage((VideoFormat) buf.getFormat());
               //Send the image over the socket
               out.println(btoi);
         } catch (IOException e) {
             System.out.println("It bombed:" + e);
        public static void playerclose() {
           player.close();
           player.deallocate();
      class ImagePanel extends Panel {
        public Image myimg = null;
        public ImagePanel() {
        public void setImage(Image img) {
          this.myimg = img;
          repaint();
        public void paint(Graphics g) {
          if (myimg != null) {
            g.drawImage(myimg, 0, 0, this);
      }The output I get from running the server is this:
    BufferedImage@c9131c: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 320 height = 240 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0
    Now how can I turn this into an image If this output is correct?

    HUH?
    I got the one to send the images over the network. I'm now trying to get the exact feed of the webcam and sending that over the network. This is alot more difficult to accomplish but I did see where I messed up my process of sending the images was just having to save the file then open it up put it in a byte array then send that over the network to the client. Once it was at the client i was able to re-construct it and throw it up in the frame. The only problem was lag. So this tells me it would be much more faster if instead of saving the file to send the client and having to reconstruct the image I should just send the webcam feed i used to make the image.
    eh, I guess I didn't need any help.
    Hey no offense or anything but you really have to learn how to spell better.

  • Im having trouble sending messages from my iPhone 4..ever since i upgraded to iOS 5, its giving me this problem. It says your SMS mailbox is full. Delete some messages to recieve new messages.  I've deleted around 10 huge conversations, rebooted it, resto

    Im having trouble sending messages from my iPhone 4..ever since i upgraded to iOS 5, its giving me this problem. It says your SMS mailbox is full. Delete some messages to recieve new messages. 
    I've deleted around 10 huge conversations, rebooted it, restored it, done a soft and hard reset too. What should i do?

    my boyfriend restored his iphone as a brand new phone and still had this problem, he deleted all his text conversations except mine and his best friend's conversations still nothing, i told him to delete OUR conversation since its a 2 year conversation that he has NEVER deleted ..... he said YES!! we tried to delete it and the phone freezes as soon as we click on the CLEAR CONVERSATION button!!!! we tried about 5 times and this happened everytime we tried!!!! ....is like the phone doesnt wanna let go of our conversation!!! every other conversation he deleted the phone was fine except for when we try and delete ours!!
    so yesterday he left his phone alone around 4 pm since we have the apple appointment today at 130pm.......around 11 pm last night his phone went NUTS receiving all the text messages i had sent and never received!!!! and now the phone works just fine!!! ...... CONFUSED?????? yeah we are too!!!
    but we're still going to the apple store to see what they can tell us!!!

  • Can anyone help!!! I am having trouble sending only SMS messages to one number we have tried resetting our phones checking with our carriers turning off I message deleting each other's numbers

    Can anyone help!!! I am having trouble sending only SMS messages to one number we have tried resetting our phones checking with our carriers turning off I message deleting each other's numbers but nothing is working please help

    Hi there Iphone5nae,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    -Griff W.

  • Trouble sending or receiving mms, sms and iMessage pictures

    This is more of a tip than a question. My wife recently got an iPhone 4 and we had some problems with her appleID, which is what I think led to the problems with iMessage. I attempted first to reset the network settings, as well as following others advice of disabling iMessage, resetting network settings and then reenabling iMessage, but nothing helped. I could not send her a mms from my Android phone, nor could I send a photo from iMessage from my iPad. She also had trouble sending sms to other iPhone users. Something clued me in to her phone number as is it associated with her appleID. She had an appleID from before she got her iPhone, when we were living in the US. Turns out the country code and country setting in her appleID were still set for the US. After changing everything to our current country of residence, I did the turn off iMessage, reset network settings and reenable iMessage routine, and then everything started working normally.
    TL:DR
    Check your appleID profile country settings, country code and phone number.
    Disable iMessage, reset network settings, reenable iMessage. Good luck!
    Thanks to eveyone else who has contributed troubleshooting advice here, and I hope my experience helps other people with their problems.

    not sure what carrier you are using but i use straighttalk and had same issue....here is how i resolved it
    1. delete any profiles you have saved settings>general>profile  delete if you see profile there if not go to step 2
    2. turn on wifi (my internet was also not working)
    3. open safari
    4. type iapnupdatetfdata.straighttalk.com
    5. download profile
    6. turn off wifi
    7. turn off phone
    8. turn on phone
    my internet and pictures worked after this, any user, any carrier, no issues....hope this is helpful!

Maybe you are looking for

  • Disable context menus in Start Screen in Windows 8.1 Update 1

    Is there a way to disable the context menus introduced with Windows 8.1 Update 1?  They make customizing the Start screen much less user friendly than it was previously. For example, if I want to move/customize multiple tiles, I have to either do it

  • How do I place a Vcard in adobe muse program.

    I have a .vcf file. My client wants to place the v cards for all of there employees on there new website I am designing. I am using Muse to design there website. Thanks

  • Delete is taking more time

    Hi all, I have a table having 5 columns. Out of which one column is a blob. The table is too small having size as 65k. Last night, it was analyzed. Everything is ok. No partitions.... But the problem is whenever, i am deleting the table, it is taking

  • Aperture 2.0 - Customizing the Adjustment Tab

    Is there any way to customize the Adjustment tab to display the Sharpen and Edge Sharpen module instead of adding the modules manually to each image?

  • Opening images in emails

    When I open emails, the images do not open and simply appear as ?. Any idea how I can see images?