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 was working on a psd with multiple layers, having not saved, the program crashed. I reopened the file and my layers (that were saved from a previous session) were gone- leaving me with a flat image. Why? Is there a way to retrieve them, I am assumi [More]
I have a need to create a combo box that can display multiple lines how can i do that on a pdfAdd multiple items.Read other 2 answers [More]
can i lock an app on my iPhone with a different password than the one i use to lock my phone?This should work; one of my e-mail accounts is my own domain through Gmail.  Make sure your username is set to your full e-mail address (like [email protecte [More]
hello, I want to show a JPanel as an output without JFrame / JApplet / Window in background. My program ran successfully but without showing output. Actually I dont want title bar in an output, thats why i have selected JPanel. If anybody have idea a [More]
HI, working with ISS6 Windows 2003 and Xir2 (SP3) I am trying to make one specific user (Or all users) to have hidden (grapped) by default the navigation panel in Infoview, but this setting seems to pick the default (Display=true) not from the user's [More]
Hey Folks , My requirement is as : I wanted to do automatic GI of the goods once their GR is done and dat data should also be updated to sap tables .Now a days we are using MIGO transaction for GI and GR both ,I have found a BADI for MIGO also but i [More]
i fixed the frozen screen now I'm trying to fix my power button it is stuckAre you updating through the phone or through iTunes on a pc/mac? The time it takes to download the update depends on the speed of the internet connection you are using.Read o [More]
I began my motion project with an HDV 1080i 60 preset. When it came time to export I exported to a quicktime file using the HDV1080i60 compressor. (1440x1080) When go into FCP and try and drop the file into an HDV 1080i60 sequence I am forced to rend [More]
Hi, Chrome suddenly doesnt show my muse site, saying:"duplicate headers detected from server" and "ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH",( but only in some computers) and in Firefox says "corrupt content" ( but only i [More]
Just converted from Windows and unfortunately still have to run some Windows aps, so using Fusion 3. I set TM to back up both my Mac and Windows worlds onto an external HD. I regularly take "snapshots" of the Windows material to make certain tha [More]