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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:50:38+00:00 2026-05-25T16:50:38+00:00

I need this because I am using AJAX to transfer a file, hence I

  • 0

I need this because I am using AJAX to transfer a file, hence I get an image file in a base64 encoded string. I would like to convert this nicely to the FileStorage object so I can use flask-uploads library nicely. Any idea how I can do this? Thanks!

  • 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-25T16:50:38+00:00Added an answer on May 25, 2026 at 4:50 pm
    def open_file(file_name):
        """
        opens file in samples, and return base64 encoded streams.
            feel free to use this code if it is helpful.
        """
        from backend import backend
        sample_dir = backend.config["samples_dir"]
        file = open(os.path.join(sample_dir, file_name), 'r')
        stream = file.read()
        encoded_stream = base64.b64encode(stream)
        return encoded_stream
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the microsoft ajax and the ajax form looks like this <%
I need this because the constructor in the superclass is calling a method which
I don't need this declaration because it only makes my code big and unreadable.
[Revision 5/14/09: I need this to target Dotnet 2.0 because of my deployment scenario]
$('input[type=checkbox]').unbind().click(function(e){ $(this).attr('checked', true) return false; }); I NEED to return false because I have
So from this string: name[id] I need this: id I used str.split ('[]'), but
I'm trying to get a tracking script working that uses AJAX via JQuery. This
I using this Ajax.BeginForm <% using( Ajax.BeginForm( Create,Mandate, new AjaxOptions( ) { OnSuccess =
I have an xml file which I imported in my html page like this:
I'm going to get the checked radio button value using AJAX in PHP. I

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.