• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to upload file using put in java  RSS feed

 
Niti Kapoor
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Staff note (Liutauras Vilda):

Fixed added code tags

 
Niti Kapoor
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to upload a file using put but its giving mew output like this
run:
OK
98
47
104
111
--- (TimM: deleted hundreds of lines)
115
116
115
39
44
1010
41
BUILD SUCCESSFUL (total time: 0 seconds)
 
Tim Moores
Saloon Keeper
Posts: 4034
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you printing out those numbers? I don't see how they're relevant (and I'm going to delete most of them now, as they provide no insight, and take up lots of space).
 
Tim Moores
Saloon Keeper
Posts: 4034
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I've added code tags to your first post. See how much better it looks? Please do that in the future when posting code of any length.
 
Niti Kapoor
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks tim for the format and I'm printing the response code but file is not uploading to the web server
 
Tim Moores
Saloon Keeper
Posts: 4034
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those are not just the response codes - almost all of it is the output from line 46 - which is irrelevant for the purposes of uploading.

I see that in lines 36/37 you are suppressing an IOException without so much as printing a stack trace - how will you what problems there are? Don't ever do that.
 
Norm Radder
Rancher
Posts: 2240
28
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm printing the response code

Those printed values look like the int values for ASCII characters.  Try casting the values that were read to char  to see what the contents of the server's response was:
 
Niti Kapoor
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks norm You save my day awsum
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!