Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Load File from URL Problem, the file is to small and header is broken  RSS feed

 
Christian Schulze
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I try to load a file from a Webserver with a given URI. First thing I am inside a JiraPlugin.

My Problem is: the size of the picture on the server is 42kb, after I put it in the local File it is 19,2kb and the header is broken.

I tried this:



Can anyone tell me what I do wrong?

regards
 
Tony Docherty
Bartender
Posts: 3195
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to make sure you flush and/or close the output stream. You should also close the input stream if you no longer need it.
 
Tony Docherty
Bartender
Posts: 3195
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to the Ranch.
 
Christian Schulze
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I try this, but it didn't work.
The problem is that every file has a size of 20 kb after download. So I try to put the stream into a text file, and then I see it is html and the server want username and password.

 
Tony Docherty
Bartender
Posts: 3195
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, that would explain it then. But my earlier comment about flushing/closing the streams is still valid.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!