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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:53:06+00:00 2026-05-21T10:53:06+00:00

I have an app running on web2py. For this app I want to store

  • 0

I have an app running on web2py. For this app I want to store a lot of files to a database for each user, which they can either upload from their own computer or they can create online and save. These files can be either text or binary files, but if they are created in my app, they will be text. So I have 2 ways files come in that I have to handle:

1) Uploads through a form. The database has a “file” field of type “upload” which I store using:

db.allfiles.insert(filename=filename, \ 
    file=db.allfiles.file.store(file.file,filename),user=me) 

This creates a file with a unique string attached to its name in the uploads directory. This solution is pretty easy.

2) I also need to store files that come in as strings via JSON call. I am not sure how to create “upload” type files and give them unique names in the uploads directory. Can anyone give any insight?

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-21T10:53:06+00:00Added an answer on May 21, 2026 at 10:53 am

    I think you can just the incoming data, turn it into an in-memory stream and store it like you do at 1)

    import StringIO
    fileHandle = StringIO.StringIO ( JSONvar )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a poll app running on facebook (each user gets a vote each
I have a rails app running on passenger standalone, which is working perfectly. I
We have an app running on JBoss. This app has one or two bugs
I have an app running which looks at items in a queue, then based
i have in my localhost:8111 a restlet app running. This app have a ServerResource
I have an app running on heroku, which I versioning on github too. But
We have an app running on a Facebook tab at the moment which is
I have a python app running fine on Windows, Linux and Mac which I
I have an app running. I want to create a UserNotifications migration that belongs_to
Is it possible to have an App (running iOS4 on hardware supporting multi-tasking) which

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.