Closed katieunger closed 5 years ago
Hi @katieunger there's not much you can do here, modern browsers doesn't allow you to get the full path of a file, because of security concerns...And this is good practice imo, it wouldn't be nice if any website could see my local file structure :) What you can offer is to upload zip files, and on the server/DB side you can unzip it with e.g. APEX_ZIP. There you can have the full path of any file contained in the zip...
Hi @Dani3lSun
Thanks for the clarification. Is there a way to get not the full path, but the relative path for files contained within subdirectories? E.g. if I have selected and dropped:
bootstrap/ ├── css/ │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── bootstrap-theme.css │ └── bootstrap-theme.min.css ├── js/ ├── bootstrap.js └── bootstrap.min.js
Can I get the paths like:
bootstrap/css/bootstrap.css bootstrap/css/bootstrap.min.css, etc.?
I'm sorry to disappoint you :( but the only thing which you can access in the browser is the file name and other file properties, but nothing there to get path informations...
https://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav https://stackoverflow.com/questions/11471068/javascript-get-full-path-of-an-uploaded-file https://www.quora.com/How-can-I-get-Absolute-path-of-a-file-using-javascript
Only solution would be using a zip file, which is what APEX does it self when you upload a zip file in Shared Components > Application Files for example
Thanks for your help, @Dani3lSun -
Our fallback was using .zip files, so we'll return to that - I was hoping to get around trying to split these large .zip files (too large for our server/network to handle!) by allowing the user to simply upload all the contents of the compressed directory.
Ideally we would be able to use the chunked upload mechanism, but it looks like this doesn't work with our web server (Oracle-HTTP-Server-12c).
How large are the zip files? Thus you posted a bootstrap folder/file structure from a web project it shouldn't be too large or am I wrong? The "normal" upload (I really should rename it :) ) should be the better solution thus it's using a multipart/form-data request to the server which uploads the file directly as a binary. Chunked is splitting the file into 1MB peaces and encodes each part to base64, on the server side it has to be decoded + putting all parts together, this costs a lot of CPU power and is especially for larger files very slow...
Ah I just saw that you are using an old version of the plugin...Yeah only the last versions of it (for APEX >= 5.1.x) supports that faster multipart/form-data method...
Hi @Dani3lSun
Sorry, the bootstrap folder/file structure was just an example I grabbed. Our files can be around 100-200 MB, which isn't so large, but our client's network connection is not very fast/reliable, and I think the maximum size allowed by the server is 50 MB (or it might be even less).
The multipart/form-data method sounds promising, maybe we can get upgraded to a newer version of APEX so we can utilize that.
Thanks again!
Yeah that would be good, second positive thing about the multipart/form-data method is, that it's normally not limited in file size by web servers...
Hi @Dani3lSun, thanks for all your excellent work on the APEX Dropzone plugin.
I am trying to implement an instance of the plugin which can receive all files within a folder, (with some files that are nested within subfolders) that writes the relative path/directory data for files within subfolders to the database.
We are using a Dynamic Action on the Dropzone Upload Completed event to execute PL/SQL to write the files into a table.
This part is working great! However, we would like to be able to get the path in addition to filename, mime_type, etc. attributes from the DROPZONE_UPLOAD APEX collection. Is there a way to do this? I see that the file.name and file.type are included in the POST in apexdropzone.js - is there a way to get the fullPath attribute from Dropzone?
We are using the Normal upload mechanism.
Expected behavior
File path is included in data posted to APEX collection DROPZONE_UPLOAD.
Actual behavior
File path is not available.
Steps to reproduce the issue
APEX version (4.2.6 / 5.0.3)
5.0.4.00.12 (We are using version 2.2.0 of the plugin due to our APEX version.)
Used web server / version and platform (ORDS 3.0.3 / Tomcat 7 / Apache 2.4 / Linux x64)
Oracle-HTTP-Server-12c
Used web browser / version and platform (Chrome 48 Mac / Firefox 44 Windows)
Firefox 67.0.4 (64-bit) Mac