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 8643013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:55:36+00:00 2026-06-12T11:55:36+00:00

I am trying to upload an xml file to an Amazon S3 server. My

  • 0

I am trying to upload an xml file to an Amazon S3 server. My code in ruby goes like this:-

AWS::S3::S3Object.store("dir/data.xml",
                            "#{xml.target!}",
                            "bucket",
                            :access => :private,
                            :content_type => 'text/xml')

The xml is an RSS feed file. When I download the uploaded file from the server, the file is missing the last line from the file.

</rss>

Removing the optional parameter content-type has no effect on the output. However, changing the data component to insert additional characters makes those missing characters appear corectly.

AWS::S3::S3Object.store("dir/data.xml",
                                "#{xml.target!}         ",
                                "bucket",
                                :access => :private,
                                :content_type => 'text/xml')

Even though this solves my problem, I am a little reluctant to use this code in production. Also, I would like to know what is going wrong?

As a matter of fact, when I write to a file on my local machine, it works correctly.

file = File.new("/path/feed.xml", "w")
    file.write(xml.target!)
    file.close

Update: I am facing the same problem while uploading a csv file as well. I notice that for very large files, even more data is truncated. For the xml file, not only the closing rss tag, but a few other tags are also missing. Similarly for the csv file. How do I resolve these?

  • 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-06-12T11:55:38+00:00Added an answer on June 12, 2026 at 11:55 am

    Sending the xml.target! as data was somehow resulting in this problem. In order to solve this I created a new string using StringIO.new.

    For csv, i used something like this :-

     csv_string = StringIO.new(csv_string)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to upload an xml file to Artifactory using their Deploy api call.
I am trying to achieve BOOLEAN return (true/false) based on XML file upload by
I'm trying to load a xml file located on wikipedia but I get this
I'm trying to implement this method of making a nice form upload: www.kavoir.com/2009/02/styling-file-upload-select-input-control-input-typefile.html/ which
I'm trying to send an XML file to a server as part of the
I'm getting this error (see title) while trying to parse an XML file in
I'm trying to upload Excel (2003) file into Sql server 2005. At present we
I am trying to load an xml file from wikipedia into my flash movie.
I want to read a client side XML file uploaded via upload file dialog.
I'm trying to upload a file to SharePoint programmatically via a Mac Application that

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.