Comments (7)
For router.get('/test', ...)
, there would be no req.params[0]
, but I guess you aren't even using the params
variable above.
In this example you posted, you are just doing an s3.listBuckets
, so if that doesn't work, I'm not sure what the issue could be. Not sure this has anything to do with react-s3-uploader
if you can't list buckets with this code.
It could be that you need to specify the region
, but you may want to create an issue with aws-sdk
.
from react-s3-uploader.
I think i figured out the problem. Looks like there is an undocumented option getFileKeyDir that needs to be set as follows
app.use('/s3', require('react-s3-uploader/s3router')({
getFileKeyDir: function(req) {return("folder")},
bucket: "bucket"
}));
If getFileKeyDir is not set it defaults to a function that returns "."
This results in the Key param that is used in the getSignedUrl calls being set to "./"
The getSignedUrl call will then sign the url using that Key. However, the actual url that is used to GET the image will not have the "./" characters.So the URL's do not match, hence the signature matching error.
So, create at least one directory in the bucket, and have it as the return value in the getFileKeyDir function.
from react-s3-uploader.
Ah, good catch. We should document that feature, but also return "" if not implemented. Thanks for the research.
from react-s3-uploader.
Just put up a fix on branch fix-getFilKeyDir
. Can you try it out in your application and see if it works as expected?
Add this to your package.json
to test the branch:
...
"react-s3-uploader": "odysseyscience/react-s3-uploader#fix-getFilKeyDir",
...
Delete node_modules/react-s3-uploader
first, then run npm install
If all looks good, I'll push an update to NPM.
from react-s3-uploader.
Works for me. Thanks
On Apr 30, 2015, at 3:21 PM, seanadkinson [email protected] wrote:
Just put up a fix on branch fix-getFilKeyDir. Can you try it out in your application and see if it works as expected?
Add this to your package.json to test the branch:
...
"react-s3-uploader": "odysseyscience/react-s3-uploader#fix-getFilKeyDir",
...
Delete node_modules/react-s3-uploader first, then run npm installIf all looks good, I'll push an update to NPM.
—
Reply to this email directly or view it on GitHub #9 (comment).
from react-s3-uploader.
Pushed version 1.1.8
. Thanks
from react-s3-uploader.
For those of you may encountered this problem, make sure your stringToSign
responsed by aws is the same to the API calculated.
Search for stringToSign
and put breakpoint there to debug.
from react-s3-uploader.
Related Issues (20)
- MultipartUpload support? HOT 1
- Method Not Allowed 405 PUT Error
- index.d.ts missing methods/props HOT 1
- ReactS3Uploader.propTypes is undefined when deployed on Heroku HOT 3
- Domentation for all the props
- iPhone camera video quality issue
- Console Warning: getDefaultProps is only used on classic React.createClass...
- Content-Type is blank when uploading HOT 3
- How to notify server of image upload? HOT 1
- Is the "accept" prop even being used? Where can we find a list of valid prop arguments? (Duplication of #220) HOT 2
- Return boolean or Promise on file upload
- Can't limit upload size HOT 1
- Getting CORS error on uploading file on AWS S3 HOT 3
- Unable to generate a valid signed upload URL for Digital Ocean spaces
- Type for signingUrlHeaders is wrong HOT 2
- findDOMNode is deprecated in StrictMode HOT 1
- Uncaught ReferenceError: process is not defined - Chrome browser Console error HOT 2
- Upload error 400 after onProgress reports all the way through 100% HOT 4
- Mime-types modules is not intended to be used with browser HOT 2
- Upload error: Could not contact request signing server
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 react-s3-uploader.