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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:08:41+00:00 2026-06-09T00:08:41+00:00

My app has a python (bottle.py) backend and an html/jquery frontend. I am getting

  • 0

My app has a python (bottle.py) backend and an html/jquery frontend.
I am getting a text file using ‘input’ in a form and uploading it in background, using event handler on a python side. The event handler then parses the file (calling file.readline() repetitively) and returns some result in json form back.

Everything goes well until I need to parse the file in python.

Here is my javascript:

function UploadFile() {
    var file = $('#data')[0].files[0];
    var formData = new FormData();
    formData.append("file", file);
    $.ajax({
        url: 'plates',
        type: 'POST',
        data: formData,
        cache: false,
        contentType: false,
        processData: false,
        success: function(data){
            ...
        }
    });
}

When I recieve the POST request on the python side, I can read it only with request.body.read().decode(). If I am trying request.files.data.file.read(), I am getting the ‘broken pipe’ error:

socket.error: [Errno 32] Broken pipe

I can just get the text with request.body.read().decode(), save them to file and then load it and parse. But I would like to avoid creating files that are not necessary to create, and want to do everything in memory.

Why does request.body.read().decode() work and request.files.data.file.read() doesn’t?
Is there any way to parse the file with my existing function while not writing it to a disk?

  • 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-09T00:08:42+00:00Added an answer on June 9, 2026 at 12:08 am

    I suggest making sure that your request is submitted with the content-type "multipart/form-data". The default is "application/x-www-form-urlencoded", which might not be what bottle expects when trying to parse a file.

    RFC 2388 is a good (albeit thick) source of information if you want to learn more about handling multipart forms in HTTP (including files)

    Also, here’s a good discussion about file upload with jQuery.

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

Sidebar

Related Questions

So I've written an app in Python that has a main .py file and
My app has a function where it takes user input and then calls HttpGet
On Google App Engine in Python, I have a Visit entity that has a
I have a wxpython app designed using XRC which has a multiline textctrl inside
I'm currently writing a small python app that embeds cherrypy and django using py2app.
I'm using Jinja2 templates with Bottle.py and Google App Engine's dev_appserver for development. I
I have a django app which has html templates and I also have a
I'm using App Engine with Python. In order to store the images of my
I'm using App Engine python to host an application and would love to use
I've got a page on my Python app which has a drop-down box of

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.