Sitemap

Amicuk Programming Answers

Whose files do I see in wwv_flow_files.

2015-10-11   Views:0

Advertisement

Hi, I wish to download and run a piece of vbscript in the users environment. The vbscript does a mail merge with word, dowloading the mail recipients through a URL that I provide. Using the upload/download tutorial I have created my own procedure to

Hi,
I wish to download and run a piece of vbscript in the users environment. The vbscript does a mail merge with word, dowloading the mail recipients through a URL that I provide.
Using the upload/download tutorial I have created my own procedure to download a file which I have uploaded.
The procedure goes like this:
create or replace procedure run_vbscript
as
v_length number;
v_file_content blob;
v_blob blob;
v_clob clob;
v_errmsg varchar2(100);
begin
begin
select blob_content
into v_file_content
from wwv_flow_files
where filename = 'labels.vbs';
exception
when others then
v_errmsg:= substr(sqlerrm(-sqlcode),1,100);
DBMS_LOB.CREATETEMPORARY(v_file_content, true, DBMS_LOB.SESSION);
dbms_lob.writeAppend(v_file_content, length(v_errmsg), utl_raw.cast_to_raw(v_errmsg));
end;
-- set up http header
-- use an nvl around the mime type and
-- if it is a null set it to application/octect
-- application/octect may launch a download window from windows
owa_util.mime_header('text/vbscript', false);
-- set the size so the browser knows how much to download
v_clob := to_clob('Dim sServer' || chr(10) || ' sServer = "http://<link to xml generating page>"');
v_blob := wwv_flow_utilities.clob_to_blob(v_clob);
dbms_lob.append(v_blob, v_file_content);
v_length := dbms_lob.getlength(v_blob);
htp.p('content-length: ' || v_length);
-- the filename will be used by the browser if the users does a save as
htp.p('content-disposition: attachment; filename="labels.vbs"');
-- close the headers
owa_util.http_header_close;
-- download the blob
wpg_docload.download_file(v_blob);
end run_vbscript;
grant execute on run_vbscript to public
The tricky thing is that when I run this procedure in the SQL Workshop, I get the contents of my uploaded file. When I invoke it from a URL where the URL is #OWNER#.run_vbscript, the procedure executes but the file contents is replaced by the error message "No data found".
Replacing "where filename = 'labels.vbs'" with "where rownum < 2" will provide me with a file from a completely different user.
What is the reason, and what is the best solution?
Thanks in advance,
Torben

The replay answer
Advertisement
Torben - The wwv_flow_files view shows you documents in the documents table (defined in the DAD) that are associated with the workspace to which you a currently authenticated. This is the workspace you logged into for SQL Workshop, or the workspace associated with the APEX application that is running your query against the view. If you run the procedure through the URL directly, you are not authenticated so you don't see any rows (except a few orphaned documents).
If you upload files and transfer them to your own table, then you could download from your table, implementing whatever security measures you deem appropriate.
Scott

Go to See the other 3 answers

How to get all image files from a folder to wwv_flow_files?

Category:DefaultRelease time:2015-10-11Views:130

Hi there! Is it possible in apex to show, in a report look-a-like, all image filenames from a folder in another machine (i enter in that machine by ip) and insert all files into wwv_flow_files? I want to see all files, then pick one and open a image.[More]

Whose files do I see in wwv_flow_files.

Category:DefaultRelease time:2015-10-11Views:130

Hi, I wish to download and run a piece of vbscript in the users environment. The vbscript does a mail merge with word, dowloading the mail recipients through a URL that I provide. Using the upload/download tutorial I have created my own procedure to[More]

Dynamic action on File browse change event

Category:DefaultRelease time:2015-10-11Views:130

Hi Experts, apex version 4.1 This is what i'm trying to do.. i have a file browse control and a text field. when user selects a file, selected fiel's name (without file type extension) should be set to text field. I tried adding a dynamic action to f[More]

Managing wwv_flow_files table

Category:DefaultRelease time:2015-10-11Views:130

Lets say I have a file upload feature on one of my pages. When the page is submitted, the file is uploaded to the wwv_flow_files table. I have a after submit process to parse the file, load it into a collection and process the data. When the process[More]

File Browse Validation not stopping upload

Category:DefaultRelease time:2015-10-11Views:130

Hi Guys, I am using Apex 4.0 and need help with the following please: I have a file browse item which uploads a file into the built in WWV_FLOW_FILES. The problem is it uploads even when there is an error and my validation flags up. Is it supposed to[More]

How APEX stores CSS files in a database?

Category:DefaultRelease time:-0001-11-30Views:130

We are trying to locate the tables in a database, where APEX stores the CSS Aplications files? We have lost some important CSS and Java Script files and we have a backup of these files. However we can not locate the table in a database, where we have[More]

Scan for viruses before file upload

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I'm making a HR application which will allow for public users to upload their resumes in word, pdf, etc format. I'd like to scan the files for viruses before they are inserted into the DB. From my understanding, files are loaded in the wwv_flow_f[More]

Excel upload with listener

Category:DefaultRelease time:2015-10-11Views:130

Hi, I have enabled excel upload with the listener, and it actually works fine. I get the data into a collection. Now what if I want to store the file in the database? It seems that the file is NOT inserted into wwv_flow_files. Also the item that cont[More]

Uploading multiple files into wwv_flow_files.

Category:DefaultRelease time:2015-10-11Views:130

Hi, I've been happily using the apex file browse button functionality to upload files into the wwv_flow_files table and moving them over to my app specific tables for some time now. I was wondering; Is there a straight forward way of uploading all th[More]

Bug? WWV_FLOW_FILES: After File upload FLOW_ID = 0

Category:DefaultRelease time:2015-10-11Views:130

Hi all, I'm working on a DEVenabled -Environment with APEX 3.1.2. Problem While redesigning an Application I have somke strange behaviour on File Upload: The application uses a custom auth scheme. In my application an uploaded file should be moved to[More]

Upload file with iframe loos session user and session id in wwv_flow_files

Category:DefaultRelease time:2015-10-11Views:130

Hello every one, hope someone could help us with this problem. What we are trying to do is to upload a file from a jquery dialog in a appex page by redirecting the POST action of the wwvFlowForm to the iframe. *1. In the javascript there is the funct[More]

Hot
I would like to upgrade my Imac 8,1 (20 inch early 2008) from 1Gb RAM to 4 Gb. Apple no longer provides 800Mhz2DDR2 SDRAM but recommended Crucial, Kingston or RAMjet. Are there any difference in these vendors chips as the price range is from $51-$99? [More]
I have multiple tabs open. I want to look at one of them and I click on it. Instead of simply switching to that tab, Firefox opens a new window. Very annoying! Why does it do this and, more importantly, how do I make it stop? I'm using Firefox 36.0.1 [More]
I'd like to be able to export thumbnail images of my footage from my bins in my project window. Is there any way to do this in P Pro? Or another Adobe application? Thanks ChrisSimply remove/uninstall AME CS5.Read other 2 answers [More]
When I select 'Options' from the tools menu the resultant box is completely empty I am using FF 32.3 on Windows 8.1 Pro 64-bit. I prefer the pull-down menu system.hello, please try to disable the ghostery addon and see if you can still reproduce the [More]
Hi all, Here I have two questions: 1) Please let me know how to call a javafx in java program... I tried with the following code but it is not working.. The below is the java program in which I made a call to the Fx program. FxMainLauncher.java impor [More]
Hi, I need to migrate data off 1 storage-subsystem and onto another, both storage-subsystems reside in separate fabrics. Background: 2 separately administered fabrics to be consolidated in some way. current layout:                  fabric-1           [More]
Using iCloud Mail on a MacBook / Safari, e-mail messages are NOT saved - the relevant box in Preferences is unchecked. However they are saved in the Sent folder when sent from an iPhone. Is there any way they are NOT saved either way?Again, ON MY IPH [More]
My classical movements for one composer are out of order, and they are in the same order as when I had the artist box at the top highlighted in iTunes. I might have had it sorted that way accidentally when they were imported to my iPOD. They are reso [More]
I have just purchased a Lumix DMC LX3 camera. Great camera, but the raw files are not yet supported by Lightroom 2 or Camera Raw. Any way around this?Not until the next update of Lightroom. Since Photokina is round the corner, the crystal ball would [More]
I download the latest Itunes but It said my computer is not the right system... so what if I dont want to update and pay 19$? I didnt update my another macbook pro but I can still use the new itunes!! for this one, I can not get on to itunes store, o [More]