Results 1 to 6 of 6
Thread: Empty FileInputStream..
- 11-06-2009, 04:51 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 56
- Rep Power
- 0
Empty FileInputStream..
File file = new File("image1.jpg");
FileInputStream fin = new FileInputStream(file);
FTPClient client = new FTPClient();
String filename = "image.jpg";
client.storeFile(filename, fin);
fin.close();
I use that code to store an image to my server. It works an image gets saved as image.jpg. The width and the heigth of the image are equal to those of the bufferedimage, but the whole image is just transparent. There are no colors in it.
There is also nothing wrong with the BufferedImage, because the image1.jpg (which gets stored in my own folder) is normal, and looks like it should be.
- 11-06-2009, 07:15 PM #2
Member
- Join Date
- Feb 2008
- Posts
- 78
- Rep Power
- 0
Then, what is your question or have I misunderstood you?
- 11-07-2009, 02:22 PM #3
Member
- Join Date
- Oct 2009
- Posts
- 56
- Rep Power
- 0
2shared - download image.jpg
There you can download the image, it is very weird that is doesn's works. If I try it like this for example:
File file = new File("lolz.jpg");
ImageIO.write(bimg, "jpg", file);
FileInputStream fin = new FileInputStream(file);
String filename = "image.jpg";
client.storeFile(filename, fin);
Then the image uploaded to my server is totally transparent. The lolz.jpg that is stored on my pc is normal. Also when you download the image that was originally stored on my server and you try to open it with any program you will see it won't open it. Also the one on the server is around 200 bytes smaller then the one stored on my pc..
- 11-08-2009, 03:31 PM #4
Member
- Join Date
- Oct 2009
- Posts
- 56
- Rep Power
- 0
Could someone please look into this?
Because the whole ftp thing finally works, this is the only problem left.
- 11-08-2009, 04:17 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
- 11-08-2009, 08:21 PM #6
Member
- Join Date
- Oct 2009
- Posts
- 56
- Rep Power
- 0
Similar Threads
-
FileReader Vs FileInputStream and same goes to output
By unhurt in forum New To JavaReplies: 5Last Post: 02-02-2010, 09:06 AM -
Alternative of FileInputStream to read Property File
By SE123 in forum Java ServletReplies: 13Last Post: 09-16-2009, 01:05 PM -
[SOLVED] Access Denied error using FileInputStream
By xcallmejudasx in forum New To JavaReplies: 8Last Post: 05-21-2009, 04:13 AM -
[SOLVED] Trouble with Scanner FileInputStream not finding the file
By miss.meli in forum New To JavaReplies: 0Last Post: 12-01-2008, 09:50 PM -
There's not enough memory to process the command. at java.io.FileInputStream
By mary in forum New To JavaReplies: 1Last Post: 08-03-2007, 06:17 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks