Closed ravir636 closed 2 years ago
I think you have mixed server side code with client side.
The localstorage.js
is a client file and so can't access your file system.
If you try to read files from S3/filesystem this should be handled by your server. You should also provide a route to mosaico for accessing those images.
so how we can upload images to aws S3 bucket....
There is an official SDK for Amazon services available in NPM. The documentation is quite good so maybe you should give it a try :)
I mean how or what code we have to change on main.js file ,..app.use(/upload) already use so how we can get the route while image upload on block for AWS storage
in the front-end you should configure 2 things
{
imgProcessorBackend: `url for resize`,
fileuploadConfig: { /* configuration for upload */ }
}
you can see that in this fork
in the backend you should handle those entry-points to use the S3
@Hiswe there is no server folder in my mosaico.. can you please tell how we can congifure in main.js file of backend
You will need to provide your own server logic. The server's file provided is only meant for a demo purpose.
So either you modify the existing file, or you come up with your own server (the server folder in the fork)
On Tue, May 29, 2018, 12:19 Ravi Rahangdale notifications@github.com wrote:
@Hiswe https://github.com/Hiswe there is no server folder in my mosaico.. can you please tell how we can congifure in main.js file of backend
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/voidlabs/mosaico/issues/456#issuecomment-392655601, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF3eRZ67qdNYMaHTc7nBU8vOpMIw9Szks5t3NpNgaJpZM4UPoYp .
@Hiswe can you provide simple solution so that we can modified existing files to storage in s3. like change in main.js or editer.js or server-config.js
Nope
On Tue, May 29, 2018, 13:03 Ravi Rahangdale notifications@github.com wrote:
can you provide simple solution so that we can modified existing files to storage in s3.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/voidlabs/mosaico/issues/456#issuecomment-392661935, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF3eTXgbbPo1T3JWZ_fNeuLaFkWL4UXks5t3OS8gaJpZM4UPoYp .
@Hiswe as you said change in existing so how we can.. if anything you can provide related to this its really great help for me.
https://github.com/goodenough/mosaico-backend
Also you should close this issue because it isn't related to Mosaico. The editor is a just front-end library which can be plugged to any server that have the right routes
@Hiswe its related to mosaico, when we are uploading file on blocks its automatically comes in /upload folder. so now i want to do same image store in s3 buckets. thats my point and help that i need.
@Hiswe can you please help out with these issue ..its really great help for me..
@ravir636 I've already helped you as much as I can:
Now you just need to do the thing :)
i am trying to read images from uploaded json but get the Uncaugth error: error fs.readFileSync is not a funtion. i put this code inside localstorage.js file
var fs = require('fs'); var imagepath='C://Users/Administrator/Pictures/Screenshots/12353.png';
var base64str = base64_encode(imagepath); function base64_encode(file1) { var bitmap = fs.readFileSync(file1); return new Buffer(bitmap).toString('base64'); }
appreciate any help..