Closed maahjoor closed 7 years ago
What would it mean to have a character set for an image in a blob?
I would suggest you to use the APEX collection method instead of custom table. Thus when developing a plugin I can´t know how the tables look like in your env...This method is much more flexible... You just have to read the readme :) https://github.com/Dani3lSun/apex-plugin-dropzone#inserting-uploaded-files-into-your-own-tables
I am using APEX collection method. I just add one more true action to refreshReportAfterUpload dynamic action with the pl/sql you provided to insert the file into my custom table If I upload it to apex.oracle.com, can you have a look into it please?
My whole project is stuck because of this uploading file things. I tried before the interactive gird with file upload item, but its not working. I have open a thread for that as well. https://community.oracle.com/thread/4089531
Regards.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Daniel Hochleitnermailto:notifications@github.com Sent: Sunday, October 22, 2017 11:04 AM To: Dani3lSun/apex-plugin-dropzonemailto:apex-plugin-dropzone@noreply.github.com Cc: maahjoormailto:idrees.Muhammad@hotmail.com; Authormailto:author@noreply.github.com Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
I would suggest you to use the APEX collection method instead of custom table. Thus when developing a plugin I can´t know how the tables look like in you env this method is much more flexible... You just have to read the readme :) https://github.com/Dani3lSun/apex-plugin-dropzone#inserting-uploaded-files-into-your-own-tables
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338456773, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgQL9bu06xn8AppkuB0epnvwed7v3ks5suujzgaJpZM4QB007.
As mentioned in the description you react to the Dropzone Upload completed event, after that you execute custom PL/SQL code (example in the readme), here in the insert statement you can include your custom columns, but of course you have to know the "file character set" to insert it... And after that you can do an refresh of an report... But if you have an example on apex.oracle.com I can have a look when I have time...
Thank you very much for the kind guidance and help. Very much appreciated.
I have uploaded the page into apex.oracle.com. please find the details below
Workspace =madrasa User=demo Password=demo
Application= Page=21
Problems:
Thanks again.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Daniel Hochleitnermailto:notifications@github.com Sent: Sunday, October 22, 2017 11:20 AM To: Dani3lSun/apex-plugin-dropzonemailto:apex-plugin-dropzone@noreply.github.com Cc: maahjoormailto:idrees.Muhammad@hotmail.com; Authormailto:author@noreply.github.com Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
As mentioned in the description you react to the Dropzone Upload completed event, after that you execute custom PL/SQL code (example in the readme), here in the insert statement you can include your custom columns, but of course you have to know the "file character set" to insert it... And after that you can do an refresh of an report... But if you have an example on apex.oracle.com I can have a look when I have time...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338457478, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgZU_d9FmnAIDnK4Ckp2bhE04umNfks5suuyvgaJpZM4QB007.
Ok I just had a quick look at your code... The Dropzone region settings look find, but your Dynamic Actions are a bit weird...
refreshReportAfterUpload
But when you do that you will loose the delete files functionality, because the apex collection is already deleted (You can´t delete files that are already gone)
How delete files function work: APEX collection You upload your files into an APEX collection, this will return the SEQ_ID (Kind of PK of an collection) to the client. When you click the delete link, a delete of one record in the collection is done, with that SEQ_ID
Custom table You upload your files into an custom table, this will return the ID (PK of your table generated by Before Insert Trigger) to the client. When you click the delete link, a delete of one record in this table is done, with that PK
So you can´t mix that 2 methods. You can´t upload to APEX collection, then do an insert to your table and delete the collection after that. And then do an delete on link click of one file of the APEX collection...The collection is already empty at this point...
You can solve this by having a temp upload page. So you upload all files to a collection, have the delete function on, so users can delete single files from this collection. And you have a separate "save" button that executes an insert into your own table at the end...
Custom table You upload your files into an custom table, this will return the ID (PK of your table generated by Before Insert Trigger) to the client. When you click the delete link, a delete of one record in this table is done, with that PK
thats what i want. but do you know how to refer to the foreign key in the grid above?
detail question:
i have a grid named dropzone section progress details it has a primary key called EE_SEC_PROGREES_ID. select the user select any row in this grid and try to click on dropzone region to upload a file, this primary key should be used when the files are uploaded to my custom table.
I know what you will do, but this combination is not supported out-of-the-box You can either use APEX collection method, then you will be able to upload and delete files within that collection OR you can use custom table method, then you will be able to upload and delete files within that table. But if you use the custom table, your table has to be like the plugin wants it (I can´t know how all the tables outside will be structured, another user will have another column ans so on, therefore use the APEX collection way.)
But you CAN´T use APEX collection and delete files from your custom table! This combination is not supported out-of-the-box If you want to do this you have multiple options:
1) Use an dedicated temp. upload page, with Dropzone region (APEX collection + Delete function) + Report that selects that APEX collection + A button that finally saves everything in your table, like here: https://github.com/Dani3lSun/apex-plugin-dropzone#inserting-uploaded-files-into-your-own-tables with the difference that you will NOT use the event, instead you will use the button click --> e.g you upload 5 files to collection, delete 2 files of them and click the save button. Then 3 files will be saved to your table
2) Create an dropzone region (APEX collection + WITHOUT Delete function) + Report that selects your table + use the DA (Upload completed) to save files like here: https://github.com/Dani3lSun/apex-plugin-dropzone#inserting-uploaded-files-into-your-own-tables But now you have to develop your own delete function, probably an row link inside you report like here:
So you can directly delete your table files, without the dropzone native delete functionality...
Hope this helps...
Thank you so much for the guidance.
I dont want to combine apex collection and custom table. I will go for custom table instead. I have a question,
If i go for custom table, i would be able to reference a foreign key of its parent grid row?
I would be able to delete row from custom table?
Thank u so much
Get Outlook for Androidhttps://aka.ms/ghei36
From: Daniel Hochleitner notifications@github.com Sent: Sunday, October 22, 2017 9:05:03 PM To: Dani3lSun/apex-plugin-dropzone Cc: maahjoor; Author Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
I know what you will do, but this combination is not supported out-of-the-box You can either use APEX collection method, then you will be able to upload and delete files within that collection OR you can use custom table method, then you will be able to upload and delete files within that table. But if you use the custom table, your table has to be like the plugin wants it (I can´t know how all the tables outside will be structured, another user will have another column ans so on, therefore use the APEX collection way.)
But you CAN´T use APEX collection and delete files from your custom table! This combination is not supported out-of-the-box If you want to do this you have multiple options:
Use an dedicated temp. upload page, with Dropzone region (APEX collection + Delete function) + Report that selects that APEX collection + A button that finally saves everything in your table, like here: https://github.com/Dani3lSun/apex-plugin-dropzone#inserting-uploaded-files-into-your-own-tables with the difference that you will NOT use the event, instead you will use the button click --> e.g you upload 5 files to collection, delete 2 files of them and click the save button. Then 3 files will be saved to your table
Create an dropzone region (APEX collection + WITHOUT Delete function) + Report that selects your table + use the DA (Upload completed) to save files like here: https://github.com/Dani3lSun/apex-plugin-dropzone#inserting-uploaded-files-into-your-own-tables But now you have to develop your own delete function, probably an row link inside you report like here:
[files]https://user-images.githubusercontent.com/698942/31864310-7eaa64c6-b75b-11e7-9cde-2623346998aa.png
So you can directly delete your table files, without the dropzone native delete functionality...
Hope this helps...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338492793, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgX6-pUCol6QR9Tkt8cgzmj8SmxZWks5su3W-gaJpZM4QB007.
You don´t understand me, if you would like to set additional columns like foreign key column or your characterset column you MUST use the APEX collection method... As described in the readme, the custom table method works only with an table that is exactly how the plugin needs it, no additional columns...
Okay, It means I cannot adopt your plugin because I don’t have that much specialty in apex. It would be much better if you create a sample table and tell us step wise approach to handle all the complexities related to that. Because most of the users want to store the files in the database in a table. The format of that table is almost the same.
File_id File_name Mimetype Blob Date
Anyhow, I will search for some other solutions. Thank you so much for your kind support and guidance and the time you give to me. Very much appreciated.
Regards.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Daniel Hochleitnermailto:notifications@github.com Sent: Sunday, October 22, 2017 9:37 PM To: Dani3lSun/apex-plugin-dropzonemailto:apex-plugin-dropzone@noreply.github.com Cc: maahjoormailto:idrees.Muhammad@hotmail.com; Authormailto:author@noreply.github.com Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
You don´t understand me, if you would like to set additional columns like foreign key column or your characterset column you MUST use the APEX collection method... As described in the readme, the custom table method works only with an table that is exactly how the plugin needs it, no additional columns...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338495040, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgZdABz1D1M4RK-21KKgMQ-35NbYFks5su31IgaJpZM4QB007.
Okay.
I think I did it. I generate the report from my eiu_files table, I have added a recyclebin icon, upon clicking the icon, a row is deleted from my custom table. After I complete this, I want to upload the steps to do it.
Pelase tell me one things.
I want to remove the Remove File link. How to do that please check image below
[cid:image003.png@01D34BE6.5C45DCC0]
Regards.
From: Daniel Hochleitnermailto:notifications@github.com Sent: Sunday, October 22, 2017 9:37 PM To: Dani3lSun/apex-plugin-dropzonemailto:apex-plugin-dropzone@noreply.github.com Cc: maahjoormailto:idrees.Muhammad@hotmail.com; Authormailto:author@noreply.github.com Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
You don´t understand me, if you would like to set additional columns like foreign key column or your characterset column you MUST use the APEX collection method... As described in the readme, the custom table method works only with an table that is exactly how the plugin needs it, no additional columns...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338495040, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgZdABz1D1M4RK-21KKgMQ-35NbYFks5su31IgaJpZM4QB007.
Great that it worked, but that is exactly what I wrote here under point 2 :) https://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338492793 You just have to disable the integrated dropzone delete function, like:
Hi,
Here are the steps to implement the dropzone plugin into a custom table.
STEP 1. Create table custom_table( FILE_ID number primary key, FILENAME varchar2(1000),FILE_MIMETYPE varchar2(500),FILE_CHARSET varchar2(500), FILE_BLOB blob, CREATED date, ANY_FOREIGN_KEY_ID NUMBER); STEP 2. Create a hidden page item named P17_CURRENT_ROW with the following settings Value Protected = No Source = null Warn on unsaved changes =No STEP 3. Set Item value on row select Dynamic action: event = Selection Change [interactive Grid] Selection type = Region Region= your region having the primary key column [cid:image017.png@01D34CD8.190DD460] Now create two True actions for that dynamic action, one to set the hidden item value and another to refresh the (APEX Collection) region created in step below [cid:image018.png@01D34CD8.190DD460] [cid:image019.png@01D34CD8.190DD460] Step: on your dropzone region, set the following dynamic action [cid:image020.png@01D34CD8.190DD460] [cid:image021.png@01D34CD8.190DD460] Do a region refresh [cid:image022.png@01D34CD8.190DD460]
And a remove dynamic action [cid:image023.png@01D34CD8.190DD460]
Step: Modify the DB Files (APEX Collection) region’s query as below SELECT FILE_ID, FILENAME, FILE_MIMETYPE, FILE_CHARSET, round(dbms_lob.getlength(FILE_BLOB) / 1024 / 1024, 3) as file_length, CREATED, ANY_FOREIGN_KEY_ID, 0 as Download from eiu_files where EE_SEC_PROGRESS_ID=:P17_CURRENT_ROW
Page items to submit =P17_CURRENT_ROW Step: create a del column [cid:image024.png@01D34CD8.190DD460] In the attribute section of the region of the del column, add the following java script function(config) { config.views = { chart: false };
// there should already be a built in action for this but currently there isn't
config.initActions = function(actions) {
actions.add({
name: "row-delete",
labelKey: "Delete Row",
action: function(event, element) {
var rec,
view = $("#emp_ig").interactiveGrid("getViews","grid"),
row$ = $( element ).closest( "tr" );
rec = view.view$.grid( "getRecords", [ row$ ] );
view.model.deleteRecords( rec );
}
});
}
return config;
} You will get a recyclebin icon with delete functionality
That’s it. I will try to upload the application I developed in my apex.oracle.com account and share it with you in the GitHub repository of Daniel Hochleitnermailto:notifications@github.com. I am just stuck with the download link in the DB Files (APEX Collection) region. Once fixed, I will upload.
Thank you very much Mr. Daniel Hochleitnermailto:notifications@github.com. You did brilliant job by developing this plugin and great job to share with the community. Note: oracle apex is going to finish support for jquery in the future releases. What you will do with your plugin?
Regards.
From: Daniel Hochleitnermailto:notifications@github.com Sent: Monday, October 23, 2017 3:00 PM To: Dani3lSun/apex-plugin-dropzonemailto:apex-plugin-dropzone@noreply.github.com Cc: maahjoormailto:idrees.Muhammad@hotmail.com; Authormailto:author@noreply.github.com Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
Great that it worked, but that is exactly what I wrote here under point 2 :)
You just have to disable the integrated dropzone delete function, like: [page_designer]https://user-images.githubusercontent.com/698942/31885813-19796452-b7f2-11e7-856d-23d4a00b741a.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338623456, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgQt-u6F2PG5o7g24prT0aqE7R494ks5svHG9gaJpZM4QB007.
HI, I am successful in the uploading files. But I cannot manage to download. Can you help me a little please?
I have uploaded it into apex.oracle.com. details are below
Workspace=madrasa User=demo Password=demo App=DropZone Page = 17. Region=DB Files (APEX Collection)
Problems
Problem 1: P17_CUR_ROW_DBFILES_REG cannot populated when the page load. But when we check any row in the DB Files (APEX Collection) region, it is populated fine. Instead, I want it to be populated when the page loads. The first row of the region should be selected.
Problem 2: The link for download is not good. Specially the request part [cid:image002.png@01D34E66.3852AF50]
I alter the DOWNLOAD_DROPZONE_FILE process like below
CURSOR l_cur IS SELECT FILENAME AS file_name, FILE_MIMETYPE AS mime_type, FILE_BLOB AS lob_loc FROM eiu_files WHERE EE_SEC_PROGRESS_ID=:P17_CURRENT_ROW AND FILE_ID = l_file_id;
END;
Can you have a look into the application please? It is almost done, but the download cannot work.
Thank you very much. Regards. Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Muhammad Idreesmailto:idrees.muhammad@hotmail.com Sent: Tuesday, October 24, 2017 2:56 PM To: Dani3lSun/apex-plugin-dropzonemailto:reply@reply.github.com; Dani3lSun/apex-plugin-dropzonemailto:apex-plugin-dropzone@noreply.github.com Cc: Authormailto:author@noreply.github.com Subject: RE: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
Hi,
Here are the steps to implement the dropzone plugin into a custom table.
STEP 1. Create table custom_table( FILE_ID number primary key, FILENAME varchar2(1000),FILE_MIMETYPE varchar2(500),FILE_CHARSET varchar2(500), FILE_BLOB blob, CREATED date, ANY_FOREIGN_KEY_ID NUMBER); STEP 2. Create a hidden page item named P17_CURRENT_ROW with the following settings Value Protected = No Source = null Warn on unsaved changes =No STEP 3. Set Item value on row select Dynamic action: event = Selection Change [interactive Grid] Selection type = Region Region= your region having the primary key column [cid:image017.png@01D34CD8.190DD460] Now create two True actions for that dynamic action, one to set the hidden item value and another to refresh the (APEX Collection) region created in step below [cid:image018.png@01D34CD8.190DD460] [cid:image019.png@01D34CD8.190DD460] Step: on your dropzone region, set the following dynamic action [cid:image020.png@01D34CD8.190DD460] [cid:image021.png@01D34CD8.190DD460] Do a region refresh [cid:image022.png@01D34CD8.190DD460]
And a remove dynamic action [cid:image023.png@01D34CD8.190DD460]
Step: Modify the DB Files (APEX Collection) region’s query as below SELECT FILE_ID, FILENAME, FILE_MIMETYPE, FILE_CHARSET, round(dbms_lob.getlength(FILE_BLOB) / 1024 / 1024, 3) as file_length, CREATED, ANY_FOREIGN_KEY_ID, 0 as Download from eiu_files where EE_SEC_PROGRESS_ID=:P17_CURRENT_ROW
Page items to submit =P17_CURRENT_ROW Step: create a del column [cid:image024.png@01D34CD8.190DD460] In the attribute section of the region of the del column, add the following java script function(config) { config.views = { chart: false };
// there should already be a built in action for this but currently there isn't
config.initActions = function(actions) {
actions.add({
name: "row-delete",
labelKey: "Delete Row",
action: function(event, element) {
var rec,
view = $("#emp_ig").interactiveGrid("getViews","grid"),
row$ = $( element ).closest( "tr" );
rec = view.view$.grid( "getRecords", [ row$ ] );
view.model.deleteRecords( rec );
}
});
}
return config;
} You will get a recyclebin icon with delete functionality
That’s it. I will try to upload the application I developed in my apex.oracle.com account and share it with you in the GitHub repository of Daniel Hochleitnermailto:notifications@github.com. I am just stuck with the download link in the DB Files (APEX Collection) region. Once fixed, I will upload.
Thank you very much Mr. Daniel Hochleitnermailto:notifications@github.com. You did brilliant job by developing this plugin and great job to share with the community. Note: oracle apex is going to finish support for jquery in the future releases. What you will do with your plugin?
Regards.
From: Daniel Hochleitnermailto:notifications@github.com Sent: Monday, October 23, 2017 3:00 PM To: Dani3lSun/apex-plugin-dropzonemailto:apex-plugin-dropzone@noreply.github.com Cc: maahjoormailto:idrees.Muhammad@hotmail.com; Authormailto:author@noreply.github.com Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
Great that it worked, but that is exactly what I wrote here under point 2 :)
You just have to disable the integrated dropzone delete function, like: [page_designer]https://user-images.githubusercontent.com/698942/31885813-19796452-b7f2-11e7-856d-23d4a00b741a.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-338623456, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgQt-u6F2PG5o7g24prT0aqE7R494ks5svHG9gaJpZM4QB007.
Thanks for sharing your solution! Unfortunately I´m not really having the time to help you on general APEX questions... For everything not associated with the plugins, please go to the Oracle APEX Forum and ask your questions there: https://community.oracle.com/community/database/developer-tools/application_express But downloading a BLOB is always the same, just google it or look into my Dropzone Demo App...
To your JQuery question: APEX in not going to unsupport JQuery in future, thus a lot of logic in the client side code of APEX itself is JQuery code...What comes is an upgrade to an newer version of JQuery, and this shouldn´t be a problem for this plugin...
Dully noted.
Thanks a lot for sharing such a nice plugin.
Regards
Get Outlook for Androidhttps://aka.ms/ghei36
From: Daniel Hochleitner notifications@github.com Sent: Thursday, October 26, 2017 2:50:06 PM To: Dani3lSun/apex-plugin-dropzone Cc: maahjoor; Author Subject: Re: [Dani3lSun/apex-plugin-dropzone] File Character Set (#33)
Thanks for sharing your solution! Unfortunately I´m not really having the time to help you on general APEX questions... For everything not associated with the plugins, please go to the Oracle APEX Forum and ask your questions there: https://community.oracle.com/community/database/developer-tools/application_express But downloading a BLOB is always the same, just google it or look into my Dropzone Demo App...
To your JQuery question: APEX in not going to unsupport JQuery in future, thus a lot of logic in the client side code of APEX itself is JQuery code...What comes is an upgrade to an newer version of JQuery, and this shouldn´t be a problem for this plugin...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Dani3lSun/apex-plugin-dropzone/issues/33#issuecomment-339627633, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQEbgeL3uQSHYu420PPD2i6WYG7QGsxBks5swGPegaJpZM4QB007.
Hi, I use the the query: SELECT c001 AS filename, c002 AS mime_type, d001 AS date_created, n001 AS file_id, blob001 AS file_content FROM apex_collections WHERE collection_name = 'DROPZONE_UPLOAD';
What is the setting of the file_content column in order to download?
I know how table down load works, but don't know how apex_collections download?
Thanks
Expected behavior
when uploading files to our custom tables, we have a file character set column for it along with the blob, filename, file_mimetype and data created columns. your pl/sql code which is inserting into the custom table do not reference that column
Actual behavior
no file character set column in handle
Steps to reproduce the issue
APEX version (4.2.6 / 5.0.3)
5.1.1
Used web server / version and platform (ORDS 3.0.3 / Tomcat 7 / Apache 2.4 / Linux x64)
ORDS
Used web browser / version and platform (Chrome 48 Mac / Firefox 44 Windows)
Firefox 56.01