-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support other options for image uploading #248
Conversation
Implement s3 image uploading using AWS javascript SDK. References
var AWS = require('aws');
var config = new AWS.Config({
accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2'
});
s3 = new AWS.S3(config);
var params = {
Bucket: 's3-bucketname',
Key: file.name,
Body: data
};
s3.putObject(params, function (perr, pres) {
if (perr) {
console.log("Error uploading data: ", perr);
} else {
console.log("Successfully uploaded data to myBucket/myKey");
}
}); |
@Yukaii Great PR! Thanks a lot! 😄 |
BTW, I think this should return full path with |
I'm not sure whether |
I just looked at sharp's README.md. |
7a85d11
to
4fce1b8
Compare
4fce1b8
to
aaf034b
Compare
I have to admit I did not look at the code before asking, but: could this extend to file upload beyond images? Sometimes this might come in handy to also store - i don't know - a |
@ccoenen In this PR, I only focus on image uploading & processing. IMO text-based editing is the main goal of HackMD, similar products like Hackpad or Quip have limited support for file uploading. To implement this feature, we'll need to open another api for handling file uploading specifically(s3 or filesystem), checking file size(maybe unlimited for self-hosting version) and file type in frontend code. You could open another issue to track this. 😸 |
No problem! |
Update example config for gitlab authorization
TODOs
Screentcast