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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:44:47+00:00 2026-06-13T19:44:47+00:00

I am uploading a image file to the server and resizing it to save

  • 0

I am uploading a image file to the server and resizing it to save disk space in the datastore. My method of resizing and then deleting the original blob and only keeping the smallVersion of the blob removes all metadata. Is there a way to copy the Blob metadata from the original blob and add it to the new smaller version?

def post(self):
    upload_files = self.get_uploads('file')
    blob_info = upload_files[0]
    if blob_info:
        img = images.Image(blob_key=blob_info)
        img.im_feeling_lucky()
        img.resize(width=600, height=800)
        smallVersion = img.execute_transforms(output_encoding=images.JPEG)
        file_name = files.blobstore.create(mime_type='image/jpeg')
        with files.open(file_name, 'a') as f:  
            f.write(smallVersion)
        files.finalize(file_name)
        blob_key = files.blobstore.get_blob_key(file_name)
        blobstore.delete(blob_info.key())
        blobCacheURL = images.get_serving_url(blob_key)
  • 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-13T19:44:48+00:00Added an answer on June 13, 2026 at 7:44 pm

    When you create the blob with the Files API, you can set the uploaded filename :

    file_name = files.blobstore.create(mime_type='image/png',_blobinfo_uploaded_filename=file_name_from_url)
    

    I’am not aware of other blob properties you can set, when writing a file. Are you looking for other properties beside the mime_type?

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

Sidebar

Related Questions

This is my image uploading and resizing code in codeigniter.But in my client's server
I am uploading a image file to the server. Now after uploading the file
CodeIgniter upload library only supports uploading image file from PC. I am trying to
I'm trying to implement a system of uploading a file (image) to the server
I'm uploading image file to storage server. Before uploading I should compose filename, which
I'm uploading image files from device to a PHP server by converting the file
So i'm uploading any image file via my great upload form and it uploads
I am uploading image using filedrop.js. Code in application.js file looks like this:- $(.droparea).each(function(event){
I am uploading image to server using base64 its working fine if image is
Part of my webapp involves uploading image files. On the production server, the files

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.