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

347
Views
Heroku PlayFramework - create thumbnail

I already have PlayFramework app runing , but I am in process of migrating it to Heroku. Because on Heroku I can not use local filesystem like I did in my app. I am forced to use Amazon S3 ,but I do not know how to rewrite creating of thumbnails. For that I am using :

https://github.com/coobird/thumbnailator

Thumbnails.of(picture.getFile()).size(300,300).toFile(new File("public/images/data", thumb));

The problem is that I can not do this at heroku,because file wont be saved.

How do I create thumbnails then? If I do not want to use another service which will generate thumbnails for me and save them to s3 somehow...

Honestly if I would know how many different services would I need for simple page with java then I would stay at php forever...

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In Heroku (as in many PaaS) there's no persistent filesystem. However, you do have access to temp directory. So you could save it into a temp file

File temp = File.createTempFile("prefix", "suffix").getAbsolutePath;
Thumbnails.of(picture.getFile()).size(300,300).toFile(temp, thumb));

Then take that file and upload it to S3. If you strictly insist on not using S3 for storing binary files, then you could base64 the file content and save it into the DB. (see some pros/cons for such approach here)

about 4 years ago · Santiago Trujillo 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!