-
Notifications
You must be signed in to change notification settings - Fork 0
Initial commit #1
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
base: master
Are you sure you want to change the base?
Conversation
@jitli98 For inserting a file into postgres, look at this: https://dba.stackexchange.com/questions/1742/how-to-insert-file-data-into-a-postgresql-bytea-column The mentioned postgres function (probably For inserting files into the postgres DB, I would recommend searching for "postgres insert file into database" rather than searching about knex.js because the end result is going to be a raw SQL query that you will just execute using |
Completed the integration of Postgres into file uploads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed the integration of Postgres into file uploads.
I've also included instructions for setting up file table in the migration file.
Let me know if you want me to include those instructions in the README instead.
Add the instructions for running all migrations with npm run knex migrate:latest
, or whatever the command should be to the README.
I'm getting a "MulterError: Unexpected field". Do you have an idea of what the issue might be? |
When u do a POST request on POSTMAN, make sure to include a field name when attaching file. In this case, the field name is 'myfile'. |
Fixed the aforementioned issues. |
5d4c51a
to
f199cfa
Compare
Sorry this is taking so long. I'll be more prompt about reviewing future PRs. One more request:
|
You want me to remove the user query parameter as well? |
f199cfa
to
29262d1
Compare
@jitli98 Yeah. If the user is in the route, then it shouldn't have to be in a query parameter. |
I did the file uploads on Express but I've yet to figure out how exactly I should store them in the PostgreSQL database. Will definitely look into it the next few days.