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 Experts, We have our BI7 system connected to Oracle DB based third party tool. The loads are performing quite well in DEV environment. I would like to know, how we transport DB Connect datasources to Quality systems? Any different process to be fo [More]
hello I need to convert the following Labview 12 VIs to Labview 11. thank you in advance Attachments: QAM Demodulation.vi ‏30 KB QAM Modulation.vi ‏30 KB rx QAM.vi ‏57 KBThe conversion was done here: http://forums.ni.com/t5/Version-Conversion/need-to [More]
I have a 3GS and since I did the IOS6 update my phone won't send pictures via text message. Anyone know how to fix this?Do you have the Onavo app installed? If so, try removing it. 1. Go to your Settings app -> General -> Profiles 2. Locate the prof [More]
Hello Community, I have a problem with using variables offset for time characteristic 0CALMONTH Let's say my current query looks like this: ...................01.2006..........02.2006..........03.2006   (0CALMONTH) Sales ..............100............ [More]
Hi Dear,my client like to do F.05 (foreign curreny valuation) for all balance sheet account,but if you select "only balance in local currency" in GL master,then those GL accounts can not be picked up for F.05. SAP's suggestion is : *For normal b [More]
I"m really new at this.  Need to add music to the 3 websites I built.  They are up and running. They were built with CSS & XHTML code. IF I download Flash Player how will I add my music file?  I want my visitors to be able to stop music, and/or p [More]
I have downloaded and installed Lightroom on my Macbook Air, but it's not working for me having it on the laptop - I do most post production on my main iMac. How can I remove the programme from my Macbook and install it on my iMac? ThanksJust delete [More]
Hi All, I have created two DC's DC A,DC B. In DC A am using DC B. Application is working fine. When i enter any text in DC A that is displayed in DC B. Now i want go back from DC B to DC A for that i created an outbound plug to interface view of DC B [More]
Hello community! I'm using a table in a view, and I'd like to color some rows depending on a condition value. I've found some tips for coloring a row when using an ALV, but that's not my case. How could I do that? Thanks for any help =) Have a great [More]
Hello, I have a custom Oracle Form installed into Oracle eBusiness Suite where this form contains a Bean Area referencing a PJC (Pluggable Java Component). The PJC extends oracle.forms.ui.VBean. The PJC was being called successfully via the SET_CUSTO [More]