Comments (5)
For anyone that came here looking for an example of how to use the original file name with this plugin, check out https://gist.github.com/robksawyer/6060412c3f86ddbc68b29ed09eef75c3.
from keystone-storage-adapter-s3.
Just wanted to note that I was having difficulty in s3 with files that have spaces in them, so when I want to keep the original file name I use this:
generateFilename: file => file.originalname.replace(/ /g, '-'),
I'll also mention this for anyone who wants to generate a public url that is saved. I usually use a method that looks like this:
publicUrl : file => `https:${process.env.S3_BASE_URL}${s3FilePath}${file.filename}`,
The S3_BASE_URL is saved in the .env
file. Instead you may have a cloudfront path or whatever else you want.
from keystone-storage-adapter-s3.
Looking at the forks it seems like @GwonHyeok already found a fix for the issue.
Looks like a better, more robust solution rather than more options.
from keystone-storage-adapter-s3.
CC: @JedWatson
from keystone-storage-adapter-s3.
@robksawyer thank you - that worked a treat 🎉
from keystone-storage-adapter-s3.
Related Issues (20)
- No support for IAM roles HOT 2
- Multiple images? HOT 4
- Cloudfront support HOT 2
- Problem with updates and deletes HOT 6
- failure to prefix path with `/` results in leaking local directory info into s3 url HOT 2
- pre:upload option is gone? HOT 1
- schema option to presave image dimensions HOT 1
- Compatibility with latest Keystone version HOT 3
- Note field option
- S3 Multiple Uploads HOT 1
- ACL: "public-read" HOT 9
- Define endpoint to use other s3 compatible object storage HOT 1
- Public URL is incorrectly generated? HOT 1
- uploads added to /tmp on server HOT 1
- Digital Ocean Spaces support? HOT 1
- `encodeSpecialCharacters()` behaviour
- Dynamic path HOT 1
- Original Filename HOT 4
- "Field errors" HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keystone-storage-adapter-s3.