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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:28:30+00:00 2026-06-13T02:28:30+00:00

Now i use this code for uploading without ajax @cherrypy.expose def upload(self, file): uload_path

  • 0

Now i use this code for uploading without ajax

@cherrypy.expose
def upload(self, file):
    uload_path = pm.get_package_download_dir()
    file_name = 'some.file'

    if not isdir(uload_path):
        try:
            makedirs(uload_path)
        except ValueError:
            raise cherrypy.HTTPError(400, 'SOME_ERROR')        

    uload_path = uload_path + os.path.sep + file_name                

    size = 0
    all_data = ''
    while True:
        data = file.file.read(8192)
        all_data += data
        if not data:
            break
        size += len(data)

    try:
        saved_file=open(uload_path, 'wb') 
        saved_file.write(all_data) 
        saved_file.close()
    except ValueError:
        raise cherrypy.HTTPError(400, 'SOME ERROR')

    print 'OK'

But I can’t find any examples of ajax file uploading with Cherrypy and Jquery.
Please help!

  • 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-13T02:28:31+00:00Added an answer on June 13, 2026 at 2:28 am

    Finally, I have solved this problem via iframe

    <iframe id="iframe" name="iframe" style="display:none;"></iframe>
    <form id="upload" action="./upload" enctype="multipart/form-data" method="post" target="iframe">
      <input type="file" id="file" name="file">
      <input type="submit">
    </form>      
    
    $('#iframe').load(function(){
        console.log($(this).contents().find('#uploaded').val());
    });
    

    But I still can’t get upload progress bar.
    Any suggestions?

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

Sidebar

Related Questions

Now I use this code: NSDictionary* attr = [[NSFileManager defaultManager] fileAttributesAtPath:file traverseLink:YES]; and get
now i use this code: $welcome_text = mysql_query(SELECT * FROM `text` WHERE `name` =
i am trying to use this code: <%= File.ReadAllText(Server.MapPath(Members/newsletters/welcome.html))%> which works great but now
Right now I can use this URL to request a Google Static Maps image
i use this method before 1 time. but Now i can not get video
In pylint I use this command --reports=n to disable the reports, but now I
This scenario comes up often, now that I use LinkToSql and the classes it
I've been fighting this problem for many hours now and could really use some
I use the wonderful jQuery-plugin Galleriffic to display image galeries. Now this works great,
I'm trying for hours now to solve this problem.. So.. I want to use

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.