I'm working on an apex project that involves a fair amount of JS and CSS, so I'm developing them on VSCode on my computer. The problem is that every time I want to change a file I have to go the static files page and upload each one separately. Is there a post action I can call, so that I can automate the request?
Based on the submission form (for uploading files) I constructed the following code (I've masked the IP and port):
var request = require("request");
var fs = require("fs");
upload("js", "./build/exports.min.js");
function upload(directory, filePath) {
var req = request.post("http://0.0.0.0:800/apex/wwv_flow.accept", function (err, resp, body) {
if (err) {
console.log('Error!');
} else {
console.log('URL: ' + body);
}
});
var form = req.form();
form.append("P271_DIRECTORY", directory);
form.append("P271_UPLOAD_FILE_NAME", fs.createReadStream(filePath));
form.append("P271_FILE_CHARSET", "utf-8");
form.append("P271_UNZIP_FILE", "Y");
form.append("P0_FLOWPAGE", "101;1|9");
}
But I'm getting the error shown below
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not found</TITLE>
</HEAD><BODY><H1>Not found</H1>
The requested URL /apex/wwv_flow.accept was not found on this server</BODY></HTML>
from Is there a way to automate the uploading/updating of static files to Oracle Apex?
No comments:
Post a Comment