Hi everyone, i bumped into a problem, i have a website in which i would like the user to be able to uploads files, then i would upload those files to google cloud storage and then i would download them so that the app.js script can fetch and get the file data from them. I already managed to sort out how to store the files in google cloud and download them, however i realized thet sending the files so that the app.js fetch them cannot be done , at least with the frameworks that i am working with. I am using multer, when i was storing the files locally on my machine everything worked fine since the fetch function was able to access to that folder, however when i deployed it, i also learned that you cannot upload or at least you have no idea of the heroku directory, hence i cant upload there, also for security reasons. I have been trying to wrap my head around this problem and come up with solutions that dont involve install a new dependency or learn a new framework, i want to be done with it and move on. I thought about handling the file data on the server side and then importing the modules but i cannot do that since the server serves the js file as a text/html mime type. The directory looks like this:-main -server.js-complement.js( i thought about importing the module variable here first and then adding the src script to the html but i still get the mime type error).----public----app.js(Here the fetch of the file takes place, and where i wanted to import the variable from the server or the file)Hopefully i can get some guidance, thankss.PS: Im a bit burnt out btw, maybe later on ill come back and add more things
Submitted July 31, 2020 at 07:21AM by rogerpeke97
No comments:
Post a Comment