Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Cómo cambiar el nombre de la imagen y guardarla, cuando subo una imagen a s3 usando boto3

Cómo cambiar el nombre de la imagen y guardarla cuando subo una imagen a s3 usando boto3.

ej.) fechahora.jpg

por favor ayuda....

 @app.route('/fileupload', methods=['POST']) def file_upload(): file = request.files['file'] s3 = boto3.client('s3', aws_access_key_id="mykey", aws_secret_access_key="myaccesskey" ) s3.put_object( ACL="public-read", Bucket="burket", Body=file, Key=file.filename, ContentType=file.content_type) print(url) return jsonify({'result': 'success'})
 function save() { let form_data = new FormData($('#upload-file')[0]); $.ajax({ type: 'POST', url: '/fileupload', data: form_data, processData: false, contentType: false, success: function (data) { alert("success!"); }, }); }

Creo que podemos usar este código. Pero no se pudo usar.

 extension = file.filename.split('.')[-1] today = datetime.now() mytime = today.strftime('%Y-%m-%d-%H-%M-%S') filename = f'file-{mytime}'
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede cambiar el nombre de los objetos después de cargarlos en s3.

 client.copy_object(Bucket="BucketName", CopySource="BucketName/OriginalName", Key="NewName") client.delete_object(Bucket="BucketName", Key="OriginalName")
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!