• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Send universal File over Socket (pdf,txt,doc,jpeg, png etc.) between Client And Server

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Hello I am having difficulties sending files to my server I have successfully designed a few voice messaging methods which send a wav file over the network which work great but I am unable to send a file... I see lots of examples and try to make my own but it either stalls or throws exceptions I have been reading and can't find a real credible source that neither functional or provides theory can someone please help me out? my Server is receiving and my client is sending

CLIENT





SERVER


 
Sheriff
Posts: 28322
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at lines 30 and 33 in your sendFile method. Also 41 and 45.

You don't have a good handle on the problems, I think, but I suggest doing more logging in the server.
 
travis Haycock
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, why would this code be allowing only ZIP files to go through? it seems I can send those files without any modification of the code
 
Friends help you move. Good friends help you move bodies. This tiny ad will help:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic