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
Hi, there: Our Environment: Exchange 2007(SP3) CCR Now we got a task to recover a mailbox which is still on Exchange 2007 now(but it is suspected the owner deleted many emails before he left and these deleted items is NOT recoveralble through dumpste [More]
Hi all, Can i know the path for configuring Revenue Account determination in MM. Regards, Ramaswamy.Dear, This is how Account determination done in MM, Movement types have key role as central account determination in MM side. This account determinati [More]
On my previous compter I have only one disk - c: Bought a new computer with two disks, c: (SSD) and d: (HDD). I installed PSE12 on D: Copied all my pictues under C:......./pictures to D:/Pictures. Now I want to get PSE12 to work on my new computer, b [More]
Printing From iBook To Printer on Windows Vista Desktop, Can't see shared printer on a Vista machine from a Mac, although Windows notebooks find it immediately. I have previously always had success sharing printers on Windows XP machines with my iBoo [More]
Hi, My requirement is display standard text in purchase requisition item text(text type 02).  Please let me know where should i write the code and what it the code? Thanks Alka Moderator message: please work yourself first on your requirement, if nec [More]
Hi, I'm looking for the table in SE16 that gives me the association between my technical tables and my datasources/infosources: for example: I have table /BIC/B0000161000 and I want to know for which datasource this is the PSA table... Kind regards J [More]
Sorry- really annoying problem i haven't had before and know is simple to fix but can't do it! I've captured video into a viewer and now have obviously pressed something which means i can't drag it into a time line but instead just drag it around in [More]
Hello, i have many simple vector files, created in CS6 that are over 15MB. i had deleted all swatches, brushes and symbols. I jusc cant figure out why those files are so big heres an example: and the .ai file weight is 17,1 MB link to the file: http: [More]
After installing ILife 11 some media content are missing from IPhoto, what is the problem?The problem, apparently, is that some media is missing from iPhoto. The solution is impossible to guess with that amount of information. Before anyone can help, [More]
Hi,, i want export one table with query option. my whrere conditions is where v_Customer_code in ('3658','3640','7463','7134','7195','8318','8181') please any one help me what is the syntax to export table.. i am using 10g databse on hp-ux box. Regar [More]