Oracle Magazine, July/August 2019
ORACLE MAGAZINE JULY AUGUST 2019 62 Database Developer OPEN SOURCE subsequent step but keep in mind that your application will not start until that file is created Next add the following lines below the existing call to router route router route files id get files get post files post The new route being defined is files with an optional id parameter in the path HTTP get and post requests will be routed to the respective get and post functions from the files controller module CONTROLLER LOGIC FOR UPLOADS Create a new file in the controllers directory named files js Open the file and add the following lines of code and dont forget to save your changes afterward const files require db_ apis files js async function post req res next try const maxFileSize 1024 1024 50 50MB OCI limit is 1 GB unless streaming let contentBuffer let totalBytesInBuffer 0 let contentType req headers content type application octet let fileName req headers x file name
You must have JavaScript enabled to view digital editions.