Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6590275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:16:45+00:00 2026-05-25T17:16:45+00:00

Over the web service, I am returned an array of bytes. Part of which

  • 0

Over the web service, I am returned an array of bytes. Part of which looks like the following… How do I get this back to a file? (It started as a pdf)

rg1uje94ppbarWm6azwlDCJeHFFJuXlMN532v46qiyi2u/WNVHCgl10DFe64oZVSFKHN7pZ6qaulNHULZJjix33PWhzPLBVwcbptx5Husx+a7Y4q3T76KBu7pfjvXeav1emibcBSG2mMFakTv0Ho7LvYsVf57hzUq8ptL752worpSKa3L0s9IJ6Z6qIlFzDaXW4ml+3WCWvaHhUW2H+6xfFSuhjHzL8pKmd5t3aI8vsun16YY1VwLw9ivAGX+GUPRVBOTYpVqgLikJhKB7Fkpn5SJSATFAQGoviYGsw7A+B2hA0dpVlisUf0mvC2LjYwfEhcUPGmvwG3sRpGJkUPtzXWx+5a2UaTOtytnLR9qwFbXKf8s2DxS9dR/p+/rwjb9mr24p7E2e8e/ZWNP7dpX7V7xJWpLAxu67lOYhixHFPRZff6063L5q8yGXtOc/J/YP5sSev6l8trGk+c+WNXSa5+b7PfpqY/WJbkefxp4Xe5RfaHqx6oqU/o9ObBdjn3MDm3MzkvFmrvWaXfPavC9s6/8gZZdMeI3cPyp8n/nBSnpjXYUwelZlyKm+ek7Pl8YfhXM4c6uTwxhPyJvZscfRnzaSd7cwWLTs3zj8ucXWe7TGzR+NGXumfk7HqVXCAkrJVS/T+uNDXKHSh5viMpPuTzW+vXu7vIj7eOXLT47XX1vYynzBdcaGx1qo0qrEijTL81UcSZRrFwS7Zv72L/paRvgswpPVdNKe/Qq9hT2R/XQXC8De/HaGVqkC1rkqFIxCto1vzFn1+1xGpOgu+fG/I7P7NBiqm+Ri823b7edVvMEvoIuVLjvjJ7Mv3nTRcV2ZKn+CeR06xqGtHnfN6XVCyyiRx8d2DdxbM0Whz19Imd928mSGz9KpLbXZ0NZhaNX7e08BjbR4fsO+fcdZ7fnhMz0FN2rEnplApbV+aLRt/zHFc15fDpt3/6Kz77vjM+aGNgjJ/eaCpseryirwPdcHuovZPLr3sVRnp2XZwpwH5hwrK0u3vB

Ive tried a few things, the closest is as follows (though I am unsure by the output if it is correct):

File.open(pdf_filename, 'w' ) do |output|
   byteArray.each_byte do | byte |
        output.print byte
        puts byte
   end
end

which returns in the console the following but does not create a valid file ( I assume these numbers are the bytes in Integer (base10)form or something?) :

77
52
79
89
    57
   etc..
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:16:46+00:00Added an answer on May 25, 2026 at 5:16 pm

    I am no expert.. I am learning ruby myself at the moment (looking at questions on SO to vary techniques a bit 😉

    but have you tried:

    File.open(pdf_filename, 'wb' ) do |output|
       byteArray.each_byte do | byte |
           output.print byte
           puts byte
       end
    end
    

    or maybe even (I really don’t know if that will work) I don’t have Ruby installed here to test:

    File.open(pdf_filename, 'wb') { |output|
        output << byteArray
    }
    

    I got this info from here (among other places):

    http://strugglingwithruby.blogspot.com/2008/11/ruby-file-access.html

    Binaries files are just the same; you just add a b to the second parameter of the open method.

    Depending on your byte array format, you may need to use the unpack method.

    File.open(pdf_filename, 'wb' ) do |output|
       output << byteArray.unpack("m")
    end
    

    See the following for possible parameters in the unpack method:
    http://www.codeweblog.com/ruby-string-pack-unpack-detailed-usage/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get secure web service connectivity on the iPhone over https via
I would like to know how ColdFusion serializes variables returned from web service calls
Here is what my object looks like with print_r (this is an object returned
I'm using Tibco BusinessWorks to consume a soap web service over an HTTPS connection.
I have a Linux/c client app that connects to a WCF web service over
I have a web service, that simply returns a lot of data over a
I'm calling a C# web service using the .net Service Model and occasionally this
Well as the title suggest, what is this Restful Web Service thing in Java,
I'm connecting to a web service over HTTPS. I've done all that I think
I'd like to trap any unhandled exception thrown in an ASP.NET web service, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.