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 want to create the running digital clock in my java swing application. Can someone throw some light on this how to do this ? Or If someone has done it then can someone pl. paste the code ? Thanks.hi prah_Rich, I have created a digital clock you can [More]
I have a Mobile.Me account, and have been using iSyne to sync my address book for several of my Macs for quite a long time. Suddenly, this morning, iSyne said syncing will delete all my contacts in one of my computers. I foolishly click OK, and it de [More]
On my iPhone 4s, I wanted to purchase more capacity for the iCloud. I was blocked and refered to the support. I to solve it? Thanks MeirAs Chris explained, the app belongs to the Apple ID it was purchased with. The best way to avoid this sort of thin [More]
Hello, We want to run /SAPAPO/SDORDER_DEL report to delete unnecessary Sales orders in the APO system. Before while executing this report I would like to be clear on 2 points: 1. Three tabs with various fields came up after executing this report:     [More]
.RAF files not recognized in bridge but PS ok.  Patch 7.1 installed.  Anyone know the fix?To me it seems related to your Adobe Camera Raw (ACR) converter. Clue inhere is you only miss the Raw files and have no problems in seeing other formats like jp [More]
I have had that problem with other printers too. Am using Photoshop CS3. When using Windows on a PC I can set printing quality and chose media without a problem. On the Mac I only can set size. Is the pixma 4000 too old? What Canon printer would work [More]
I asked this question in another forum here (sorry for not linking, but the forum would not let me because my account is not yet verified): http://answers.microsoft.com/en-us/office/forum/office_2013_release-outlook/rule-containing-mark-as-read-and-m [More]
Hi, Before I upgraded to Mountain Lion, whenever I opened an App that wasn't permanently on the dock, it's icon would appear on the dock temporarily when the app was open. Now, when I open an AppMore than once, I have tapped the search window on the [More]
Trying to connect Deskjet 6980 to Lenovo T 500 in wireless mode - not through router but direct. Can not seem to make this work. Any suggestionsIf you mean a USB connection, connecting the PC and printer via USB (with the printer on), should caus [More]
Hi, I have a record update form that shows Start date and End date in 2 separate fields like dd/mm/yyyy. When I edit the dates they do not get to the database correctly, all I get is 0000/00/00. I guess this is because the date format accepted by MyS [More]