Count files downloaded or viewed
I am currently using the File Upload and Download Application described in How-to Documents. I open a new browser window with my pdf document with javascript. I would like to keep track how many times a file is viewed. I added a simple query in the download procedure that inserts the ID and sysdate into a table. This seems to work but I get a double post to the table. Is there a way to keep this from posting twice.
The query is in the document_download procedure:
PROCEDURE download_document(p_file IN NUMBER,p_type IN VARCHAR2) AS
v_mime VARCHAR2(48);
v_length NUMBER;
v_file_name VARCHAR2(2000);
Lob_loc BLOB;
BEGIN
SELECT MIME_TYPE, BLOB_CONTENT, file_name,DBMS_LOB.GETLENGTH(blob_content)
INTO v_mime,lob_loc,v_file_name,v_length
FROM rlappntl.PRICE_RATE_SHEETS
WHERE rs_nbr = p_file;
owa_util.mime_header( NVL(v_mime,'application/pdf'),FALSE );
htp.p('Content-length: ' || v_length);
owa_util.http_header_close;
wpg_docload.download_file( Lob_loc );
INSERT INTO RLAPPNTL.PRICE_USAGE_COUNTER (APPLICATION, DATE_USED)
VALUES (p_type, SYSDATE);
END download_document;
Similar Messages
-
How can I save the .mp4 files downloaded from internet to ipad memory so that I don't have to download everytime to view them again. Also they might remove them from internet so I can't rely on the bookmark to them.
I'm trying to send home movies to my 10 year old nephew who lives across the country. He doesn't have a computer. He has an iPod touch. His parents have computers. But I don't want everything I ever try to have him do result in "you need your parent's computer for this." It's getting really embarrassing. I have converted my family over to Apple computers but now they want to buy iPhones, iPads, and iPods even though I tell them to go Android. It took a decade to convert them away from windows now I'm trying to keep them away from these freedom limited iOS devices and they won't listen. Then it becomes my responsibility to make their iPads print to their fancy pre-airprint color laser jet printers, get home movies onto them, and countless other things. It's driving me nuts.
I have converted these files to a format that the iOS devices will play directly off of dropbox. Now, how do I get the infernal devices to save it instead of play it? -
TAx Reporter Temse Files Download Automation
Hi,
I have a reuiqrement to download the Temse files generated in Tax Reporter. I have completed the code and it works fine if we run the program in foreground. But when I run the same program in background some Temse files downloaded have junk characters. If I download the same Temse file in foreground it works fine.
There seems to be some issue with the FM when I run my progam in background.
I have searched SDN and SAP Notes for any clues but did not get any.
REPORT ZPHOP_TEMSE NO STANDARD PAGE HEADING
LINE-SIZE 1023
LINE-COUNT 65
MESSAGE-ID zz.
DATA: BEGIN OF tape OCCURS 1,
DATA(2000),
END OF tape.
DATA: force_ascii type c VALUE 'T'.
DATA: BEGIN OF int_msgs2 OCCURS 10,
errnum(2) TYPE c,
text1(8) TYPE c,
text2(60) TYPE c,
END OF int_msgs2.
DATA: BEGIN OF g_int_temse OCCURS 0,
dname LIKE TST01-dname,
dpart LIKE TST01-dpart,
dcretime LIKE TST01-DCRETIME,
dcreater LIKE TST01-DCREATER,
END OF g_int_temse.
DATA: record_length TYPE i VALUE 275,
data_length TYPE i,
convert_to_ebcdic,
filesize TYPE i,
number_of_records TYPE i VALUE 1,
filetype(3) VALUE 'BIN',
conv TYPE REF TO cl_abap_conv_out_ce,
dline TYPE REF TO data,
dtab TYPE REF TO data,
p_compid(4),
p_pswd(8),
g_str(2000),
uc_filename TYPE string.
DATA: l_nm_fixed_record.
CONSTANTS: c_lpath TYPE pathintern VALUE 'ZOUT'.
TABLES: TST01, ZPHOPFLS, ZTEMSE_LOG, V_5UXY_A.
FIELD-SYMBOLS: <dtab> TYPE STANDARD TABLE,
<dline> TYPE ANY.
INCLUDE: dbpnpcom. " No logical database Do not modify!
INCLUDE: zphoptop, " Top Include Do not modify!
zphopfil. " File inlcude Do not modify!
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-T01.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-001.
SELECT-OPTIONS s_temse FOR TST01-dname NO INTERVALS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-T02.
SELECT-OPTIONS s_cai FOR TST01-DCREATER NO INTERVALS.
SELECT-OPTIONS s_date FOR sy-datum.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE text-T03.
PARAMETERS: p_ifid LIKE t9aoa-if_id MODIF ID DIS ,
p_fileid LIKE t9aoa-file_id MODIF ID DIS,
p_unixf(60) LOWER CASE MODIF ID DIS,
p_uxdir TYPE pathextern LOWER CASE MODIF ID DIS,
p_dstfil(45) LOWER CASE MODIF ID DIS.
SELECTION-SCREEN END OF BLOCK B3.
PARAMETERS: p_skip AS CHECKBOX.
DATA: ws_unixr LIKE p_unixf,
ws_trans LIKE p_unixf.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'DIS'.
screen-output = '1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
INITIALIZATION.
p_ifid = 'PAYFLS'.
p_compid = 'HR00'.
p_fileid = '01'.
p_unixf = 'AFS'.
p_pswd = 'chevr123'.
p_skip = 'X'.
-End of Initialization--
PERFORM get_physical_path.
FORMAT COLOR COL_HEADING.
WRITE: /01 text-t04,
10 sy-pagno,
41 text-t05,
110 text-t06,
123 sy-datum.
WRITE: /01 text-t08,
14 sy-repid,
110 text-t07,
125 sy-uzeit.
FORMAT COLOR OFF.
SKIP.
WRITE: /(20) text-T21 CENTERED COLOR COL_HEADING,
(15) text-T22 CENTERED COLOR COL_HEADING,
(20) text-T23 CENTERED COLOR COL_HEADING,
(15) text-T24 CENTERED COLOR COL_HEADING,
(40) text-T25 CENTERED COLOR COL_HEADING.
START-OF-SELECTION.
*Do not allow background processing
*Check if the Temse file and CAI both are entered
IF NOT S_TEMSE IS INITIAL AND NOT S_CAI IS INITIAL.
MESSAGE W999 WITH TEXT-E01.
ELSEIF S_TEMSE IS INITIAL AND S_CAI IS INITIAL.
MESSAGE W999 WITH TEXT-E02.
ENDIF.
Collect all temse filenames from TST01 into an internal table.
IF NOT s_temse IS INITIAL.
SELECT dname dpart dcretime dcreater FROM TST01 INTO TABLE g_int_temse
WHERE dname in s_temse
AND dpart EQ '1'.
ELSE.
SELECT * FROM TST01
WHERE DCREATER in s_cai
AND DPART EQ '1'.
IF TST01-DCRETIME(8) GE s_date-low
AND TST01-DCRETIME(8) LE s_date-high.
MOVE-CORRESPONDING TST01 TO g_int_temse.
APPEND g_int_temse.
ENDIF.
ENDSELECT.
ENDIF.
SORT g_int_temse BY DNAME DPART DCRETIME.
LOOP AT g_int_temse.
Check if the temse file is already processed in ZTEMSE_LOG table.
SELECT SINGLE * FROM ZTEMSE_LOG
WHERE DNAME = g_int_temse-dname.
IF sy-subrc EQ 0.
error. Temse already processed
CONTINUE.
ENDIF.
Check if the temse file bieng processed is the eligible temse file
SELECT SINGLE * FROM V_5UXY_A
WHERE TSOBJ = g_int_temse-dname.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM ZPHOPFLS
WHERE TAXAU = V_5UXY_A-TAXAU
AND TXFRM = V_5UXY_A-TXFRM.
IF sy-subrc EQ 0.
Generate the filename for the target destination
CONCATENATE ZPHOPFLS-FILENAME '.' sy-datum '.' sy-uzeit INTO p_dstfil.
ELSE.
error. Script not maintained in ZPHOPFLS table
CONTINUE.
ENDIF.
ELSE.
error. Temse file is not the latest processed file.
CONTINUE.
ENDIF.
CALL FUNCTION 'RP_TS_OPEN'
EXPORTING
tsobj = g_int_temse-dname
versn = g_int_temse-dpart
empfg = 'RPUTSVUM'.
COMMIT WORK.
REFRESH tape.
CLEAR tape.
Einlesen von der TemSe
CALL FUNCTION 'RSTS_READ'
EXPORTING
PARTS1BY1 = 'X'
TABLES
datatab = tape.
CALL FUNCTION 'RSTS_CLOSE'.
Read the 1st line which is supposed to contains info important for
the downloading procedure. The syntax of the line is :
SAPxxxnnnyyyy - the 1st 3 char 'SAP' indicates this line contains
download related info. xxx can either be 'ASC' (for ASCII) or 'EBC'
(for EBCDIC). nnn is the length of each record, e.g. 128 for SSA disk
format, 275 for SSA tape format etc. yyyy can either be 'CRLF' (each
record is delimited by CRLF) or blank (no CRLF).
After processing the 1st line, the line is deleted from the internal
table. Downloading begins on the 2nd line.
READ TABLE tape INDEX 1.
IF tape-data(3) EQ 'SAP'.
IF tape-data+3(3) EQ 'EBC'.
convert_to_ebcdic = 'x'.
ELSEIF tape-data+3(3) EQ 'ASC'
AND force_ascii EQ 'T'.
filetype = 'ASC'.
ENDIF.
IF tape-data+6(3) NA '*'.
record_length = tape-data+6(3).
ELSE.
record_length = tape-data+13(4).
ENDIF.
IF tape-data+9(4) EQ 'CRLF'.
data_length = record_length + 2.
ELSE.
data_length = record_length.
ENDIF.
DELETE tape INDEX 1.
ELSE.
data_length = record_length.
ENDIF.
Transfer the Temse file data to Unix file.
PERFORM transfer_file.
Update the Log table with the temse details.
ZTEMSE_LOG-dname = g_int_temse-dname.
ZTEMSE_LOG-txcmp = V_5UXY_A-taxau.
ZTEMSE_LOG-txfrm = V_5UXY_A-txfrm.
ZTEMSE_LOG-filename = ws_unixr.
ZTEMSE_LOG-DCREATER = g_int_temse-dcreater.
INSERT ZTEMSE_LOG.
WRITE: /(20) ZTEMSE_LOG-dname,
(15) ZTEMSE_LOG-txcmp,
(20) ZTEMSE_LOG-txfrm,
(15) ZTEMSE_LOG-dcreater,
(40) ZTEMSE_LOG-filename.
ENDLOOP.
*& Form get_physical_path
Get Physical directory name for the given logical path name
FORM get_physical_path .
CALL FUNCTION 'ZFILE_GET_PATH_NAME'
EXPORTING
LOGICAL_PATH = c_lpath
IMPORTING
FILE_NAME_PATH = p_uxdir
EXCEPTIONS
PATH_NOT_FOUND = 1
MISSING_PARAMETER = 2
OPERATING_SYSTEM_NOT_FOUND = 3
FILE_SYSTEM_NOT_FOUND = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " get_physical_path
*& Form TRANSFER_FILE
FORM transfer_file.
p_unixf = 'AFS'.
Concatenate Date with Unix File name
CONCATENATE p_unixf '.' p_compid '.' p_ifid '.' sy-datum '.' sy-uzeit INTO ws_unixr.
Concatenate Unix Directory with Unix File for Outbound
CONCATENATE p_uxdir ws_unixr INTO p_unixf.
PERFORM open_files USING p_unixf.
LOOP AT tape.
g_str = tape-data(record_length).
TRANSFER g_str TO p_unixf LENGTH record_length.
IF sy-subrc <> 0.
MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
' Error Transferring to: ' p_unixf.
ENDIF.
ENDLOOP.
PERFORM close_files USING p_unixf.
ENDFORM. " TRANSFER_FILE
Can anyone please check and tell me what I need to overcome this problem.Hi Bhaskar,
I also have the same requirement to upload TemSe files in to application server.
In FDTA tcode after we enter company code and click on enter.
In the second screen checking and line item and go to edit and click on download button.
Here we see a popup with default file name, and when we say ok the file will get downloaded into C:\.....
Here our req is to upload the file automatically pick up via batch job and place it in the in to the application server and from there it should be placed in the Netwrok server (UNIX).
Pls provide me with suitable code so that i can finish it off.I tried a lot but did not work.
Thanks. -
Issue with File Download(messageDownload) on Search Page.
Hi,
I created a custom OAF search page which fetches values from one table. The document in getting stored in my custom table in a BLOB colums and NOT in FND_LOBS.
The table has 3 collumns along with others:
1st is primary key (Record_Seq) ==> number data type
2nd to store actual file name (File1Name) ==> varcahar2 data type
3rd to store the actual uploaded data (File1Data) ==> BLOB data type
The reason for having the “File1Name” is so that I can display the original file name of the document that was uploaded, instead of just the “view” in the search page results .
On the File1Data BLOB and created a messageDownload for that under query results table with following details:
ID : File1Data
ItemStyle : messageDownload
FileMIME Type : pdf
Datatype : BLOB
View Instance : LacEmpExposureVO1
view Attribute : File1Name
File View Attribute : File1Data
When I click on the "File1Name" data hyperlink, it is opening only the first document corresponding to the first record in the search page results.
For example, If my search page returns 10 rows then when I click on the file1name on any row, It is open the first row file name only.
I have a primary key column(RECORD_SEQ) in the Table / EO / VO which is displayed in the search page results.
Also one weird thing is happening:
If I try to do this more than 2 times then it is opening the update page with the first record from the search page results…
I tried to print the context and it is nul the first time, But the second time then context is changing to "update". Dont know how this is happening????
Any advice is greatly appreciated as it is very crucial for me to get this resolved ASAP. I have looked at several forums and did a lot of things as advised in the forums . But nothing seems to work for me.
Thanks,
Mir
CO code for the search page
===========================
if (pageContext.getParameter("Create")!= null)
System.out.println("Into LacEmpExposureCO in PROCESS FORM REQUEST with Context of CREATE");
pageContext.setForwardURL
("OA.jsp?page=/lac/oracle/apps/lac/lacempexposure/webui/LacEmpExposureCreatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true, //Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
else if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
System.out.println("Into LacEmpExposureCO in PROCESS FORM REQUEST with Context of UPDATE");
System.out.println("LacEmpExposureCO ==> RecordSeq in PROCESS FORM REQUEST is: " + RecordSeq);
HashMap params = new HashMap(1);
params.put("RecordSeq", RecordSeq);
pageContext.setForwardURL
("OA.jsp?page=/lac/oracle/apps/lac/lacempexposure/webui/LacEmpExposureUpdatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
params,
true, //Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
OAWebBeanConstants.IGNORE_MESSAGES);
else {
String strEvent = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);
System.out.println(strEvent);
System.out.println("Into the last ELSE part in LacEmpExposureCO.java");Duplicate post -- Issue with File Download(messageDownload) on Search Page.
-
Report Print & Export Issue (File Download Box appears)
We send a URL to Crystal Enterprise which runs a script, logs on, finds folder, finds report and displays in the Crystal report viewer. All that works fine....
However, when you select the print icon or the export icon a Windows Internet Explorer box to select page range etc. and then when you say OK, you recieve a File Download Box asking to Open/Save/Cancel one of the following:
Print - Name: CrystalViewer.pdf, and Type of pdf_auto_file
Export - Name: CrystalViewer.rpt, and Type of CrystalReports
I have no IDEA what he is trying to do but he sure ain't printing. I can only assume that I have a missing part that he is trying to download at the time of print/export. Or that there is something set in the script that is killing me...
Sub ViewReport( iStore, id, token)
URI = "./viewer/en/viewreport.csp?id=" & id & "&token=" & token & GetPrompt
Set viewer = Server.CreateObject( "CrystalReports.CrystalReportViewer" )
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory")
Set rptSource = rptFactory.OpenReportSource(CInt(id))
' Set the viewer's properties to prepare it for viewing.
With viewer
.ReportSource = rptSource
.EnterpriseLogon = iStore.EnterpriseSession
.URI = URI
.ISOWNPAGE = TRUE
.ISOWNFORM = TRUE
.HasPrintButton = TRUE
.ISDISPLAYPAGE = true
.isdisplaytoolbar = true
.isDisplayGroupTree = true
.GroupTreeWidthUnit = 1
.GroupTreeWidth = 17
.HasRefreshButton = true
.HasExportButton = true
.ParameterFields = GetParams
End With
If Err.Number <> 0 Then
'There was an error setting up the viewer.
Response.Write "<p>Unable to create report viewer. " & Err.number
Else
'Process the request and launch the viewer.
viewer.ProcessHttpRequest Request, Response, Session
'viewer.refresh
End If
End Sub
Help me???Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly
-
Hi,
I am getting this error in most of our WSUS servers.
Content file download failed.
Reason: HTTP status 404: The requested URL does not exist on the server.
Source File: /Content/FB/134501186F4C81089054E4EC3376E74EEC895EFB.exe
Destination File: d:\wsus\WsusContent\FB\134501186F4C81089054E4EC3376E74EEC895EFB.exe
After few minutes, getting below error as well. But i could see the synchronization has completed successfully.
Log Name: Application
Source: Windows Server Update Services
Date: 12/19/2014 4:45:55 PM
Event ID: 10032
Task Category: 7
Level: Error
Keywords: Classic
User: N/A
Computer: ******
Description:
The server is failing to download some updates.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Windows Server Update Services" />
<EventID Qualifiers="0">10032</EventID>
<Level>2</Level>
<Task>7</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2014-12-19T08:45:55.000000000Z" />
<EventRecordID>496887</EventRecordID>
<Channel>Application</Channel>
<Computer>*****</Computer>
<Data>The server is failing to download some updates.</Data>
This error is happening everyday. Please advise for a fix.Reason: HTTP status 404: The requested URL does not exist on the server.
Source File: /Content/FB/134501186F4C81089054E4EC3376E74EEC895EFB.exe
Destination File: d:\wsus\WsusContent\FB\134501186F4C81089054E4EC3376E74EEC895EFB.exe
Source: Windows Server Update Services
Description:
The server is failing to download some updates.
This error is happening everyday. Please advise for a fix.
If this is happening on an UPSTREAM server it is because you have approved updates that are no longer available from Microsoft. Almost always this involves approvals of *EXPIRED* updates (which have been pulled from the catalog and cannot be downloaded).
If this is happening on a DOWNSTREAM server it's because something/someone deleted the files from the upstream server. It can also happen if the entire upstream ~\WSUSContent folder has gone amuk.
For an upstream server, find the expired updates, remove the approvals, cancel the downloads, and then decline the updates.
For a downstream server, figure out what the affected updates are and fix the upstream server.
Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
SolarWinds Head Geek
Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
http://www.solarwinds.com/gotmicrosoft
The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds. -
Hi All,
I have designed an APEX application to download multiple files. I have check box in each row of the file name and a download button.
When the users checks set of checkboxes and click on the "Download" Button, i am expecting the marked files to be downloaded. I am encountering the below issues in this implementation(i.e single file download is fine):
1. When ticks all the check boxes and click download, the files are never downloading. The target URL goes something like this :
www.example.com/abc/bcd/wwv_flow.accept
and there is a cross icon in the new page. No download happening.
2. When ticks few files and leave rest of the files un-checked, there are either junk charactes in target page (or) only the last checked box file alone downloading.
Please refer the code below and advice. Thanks very much in advance.
Code:
=====
declare
check_box_val varchar2(500):=' ';
file_name varchar2(500):=' ';
begin
for i in 1..htmldb_application.g_f01.count
loop
check_box_val:=nvl(htmldb_application.g_f02(i),' ');
if(check_box_val<>' ') then
sho_pdf(check_box_val);
end if;
end loop;
exception
when others then
null;
end;
sho_pdf.sql
========
CREATE OR REPLACE PROCEDURE FDM_UAT14.sho_pdf(p_file in varchar2)
AS
l_blob BLOB;
l_bfile BFILE;
BEGIN
DBMS_LOB.createtemporary (l_blob, TRUE, DBMS_LOB.SESSION);
l_bfile := BFILENAME ('UPDOWNFILES_DIR', p_file);
DBMS_LOB.fileopen (l_bfile);
DBMS_LOB.loadfromfile (l_blob, l_bfile, DBMS_LOB.getlength (l_bfile));
DBMS_LOB.fileclose (l_bfile);
OWA_UTIL.mime_header ('application/octet',
bclose_header => FALSE);
HTP.p ('Content-length: ' || DBMS_LOB.getlength (l_blob));
HTP.p( 'Content-Disposition: filename="' || p_file || '"' );
OWA_UTIL.http_header_close;
WPG_DOCLOAD.download_file (l_blob);
DBMS_LOB.freetemporary (l_blob);
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
/I have read that "patch number 8548651" need to be applied in order to download multiple files in Single Page. Is it true? Pls refer this page :
http://dgielis.blogspot.com/2010/01/oracle-application-express-patch-set.html
8555172 -- BLOB download links are incorrect when multiple file items referenced on a page. -
Error while opening PDF file downloaded from database Blob column
Hi All,
I am working on jdev 11.1.1.4.0.
In my use-case I am using filedownload Actionlistner on a link to get the PDF file stored in the database in blob field. These files are being uploaded from other use-case in adf only.
After getting the dialog box to open/save/cancel for the PDF file when i click on open then i am getting an error *'Adobe Reader could not open 'abc.pdf' because it is either not a supported file type*
or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly docoded)' for some files , and to my surprise I am able to open some files.
When I open these PDF files separately from desktop I am able to view the content of each and every file in adobe reader.
I dont know where the problem exactly lies , while uploading/downloading the file . Any ideas/thoughts to resolve this issue?
Thanks
KanikaThanks a lot Timo...!!!
I checked the PDF file downloaded directly from the blob column in DB, there only it is corrupted so must be the problem in uploading the file. I am checking the code line by line,, but no problem in setting the file content type,size etc.
Here is the code snippet ..
byte[] buff;
buff = new byte[(int)length]; -- Length is the file size
int bytesRead = is.read(buff);
for (int i = 0; bytesRead < buff.length; i++) {
// int b = is.read();
int b = is.read();
if (b == -1)
break;
buff[i] = (byte)b;
BlobDomain blobDomian = new BlobDomain((buff));
TestVORow = (TestVORow Impl)TestVO.createRow();
if(blobDomian != null) {
TestVORow.setAttachment(blobDomian);
am.getTransaction().commit();
This seems to be Ok to me..the same issue, file is still corrupting.
Any thoughts from your side ???
Thanks
Kanika
The problem is resolved.
Changes made are instead of
InputStream is;
used ... BufferedInputStream bis ;
and after
for (int i = 0; bytesRead < buff.length; i++) {
// int b = bis.read();
int b = bis.read();
if (b == -1)
break;
buff[i] = (byte)b;
bis.close(); // use this close bufferedInput Stream.
Able to open each and every file now..Thanks for your suggestions Timo and Frank.
Edited by: Kanika on Mar 6, 2012 3:15 AM -
PDF file doesn't view properly in firefox & favicon doesn't show in Safari
I've got three issues I could use some advice with.
1. I used some iFrame code generously posted by Oldtoad that allows a pdf file in an IFrame. It works beautifully in Safari. here's an example: http://web.mac.com/phelpssculpture/Site/resumeone_page_DavidPhelps.html
but in Firefox it only opens as a dialog box asking what I want to do with the file (download, etc)
Is there any way to make this view properly in Firefox?
2. I've gone through the process to have a favicon in the address box (ico file uploaded with iTweak) and this views great with Firefox, but nothing in Safari (not sure about others) I've deleted the WebpageIcons.db file repeatedly, emptied cache, deleted all my bookmarks for the site, etc.
Anyone know how to make this work in Safari?
3. I recently updated my site (from iWeb 06) using iWeb 08 and published. A lot of search links got broken. I created a new sitemap (verified by google) and now, no matter what page a search refers to, when you click on it, only my home page opens. Did I do something wrong? It used to be that if a search pointed to a certain page, clicking that result took you directly to that page.
Any suggestions for these problems would be greatly appreciated.
Thank you, DavidOld Toad:
I finally got it! the favicon works now at: http://web.me.com/phelpssculpture
Your Instructions at:http://toadstutorials.info/ #22 did the trick.
One problem I had with TextWrangle was I was doing a search and replace for <head><meta and it wasn't working. What I figured out was that there was other code on the line after <head><meta which was preventing the new code from working. I did a minor adjustment on each page in iWeb to force it to republish each page. That made the <head><meta line consistent on each page, then I selected the entire line and replaced it as per your instructions. It worked great. My experience was that iTweak did not process the code properly and was very slow, but this process was great.
Thank you for all your help. Sincerely, David -
File download from fnd_lobs
Hi all !
I am trying to implement a file download process into an existing table (table for requisition_lines_all).
I first want to test the code written in the dev guide but it is not working !
I extend the ReqLinesNotificationCo with the code :
OAViewObject fndLobs = (OAViewObject)oaapplicationmodule.findViewObject("testDownloadVO");
if ( fndLobs == null )
fndLobs = (OAViewObject)oaapplicationmodule.createViewObject("testDownloadVO", "oracle.apps.fnd.server.FndLobsVO");
fndLobs.setWhereClause("file_id = :1");
fndLobs.setWhereClauseParam(0, "402426");
fndLobs.executeQuery();
OAMessageDownloadBean downloadBean =
(OAMessageDownloadBean)createWebBean(oapagecontext, MESSAGE_DOWNLOAD_BEAN);
downloadBean.setViewUsageName("testDownloadVO"); // always gives full name of view instance
downloadBean.setViewAttributeName("FileName"); // for display text of the link
downloadBean.setContentViewAttributeName("FileData"); // the file content
// if content type is stored in a view attribute, it can be retreived through
// data bound value. Otherwise, a static value can also be set:
// e.g. downloadBean.setFileContentType("text/html")
//OADataBoundValueViewObject contentBoundValue = new OADataBoundValueViewObject(downloadBean, "FileContentType");
//downloadBean.setAttributeValue(FILE_CONTENT_TYPE, contentBoundValue);
downloadBean.setFileContentType("application/pdf");
OADataBoundValueViewObject contentBoundValue = new OADataBoundValueViewObject(downloadBean, "application/pdf");
downloadBean.setAttributeValue(FILE_CONTENT_TYPE, contentBoundValue);
downloadBean.setPrompt("Attached Document");
oawebbean.addIndexedChild(downloadBean);
When testing, the page returns :
oracle.apps.fnd.framework.OAException: oracle.jbo.NoDefException: JBO-25002: Definition FileId of type Attribute not found
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1223)
at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:2928)
at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:2725)
I thought this code should create a column with always the same file (file id = 402426), but ... No way !
Did I miss something ?
Thanks
regardsCheck the column alias for the file_id. You are using file_id but the alias mapping is set to fileid. Make sure of column alias and save the VO, test.
--Shiv -
Reg: Html file download from server
My requirement is download file from server. Am using jsp and servlet this. While downloading the file a dialog box with open, save and cancel option. When try to open html file it, open in the same window .
Req: it should be open in seperate window (ie)
Please advise me how to open a html file in seperate explorer
Am using below Code for download a file:
private void downloadFile( HttpServletResponse response, String strFileType, File file ) throws Exception
logger.trace(Util_Client.INFO, Util_Client.getInfo(), "File download Started.");
BufferedInputStream bufferedInputStream = null;
try {
String strContentType = fileExtnContentTypeMapping.get(strFileType);
if(strContentType == null)
strContentType = fileExtnContentTypeMapping.get(CLConstants.FILE_EXTN_OTHERS);
response.setContentType(strContentType);
String strHeader = "Attachment;Filename=" + file.getName();
response.setHeader("Content-Disposition", strHeader);
byte data[] = new byte[CLConstants.FILE_DOWNLOAD_STREAM_READ_BUFFER];
bufferedInputStream = new BufferedInputStream( new FileInputStream( file ), CLConstants.FILE_DOWNLOAD_STREAM_READ_BUFFER );
int count;
while((count = bufferedInputStream.read(data, 0, CLConstants.FILE_DOWNLOAD_STREAM_READ_BUFFER)) != -1 ) {
response.getOutputStream().write( data, 0, count );
response.getOutputStream().close();
}catch (ClientAbortException clientAbortException) {
clientAbortException.printStackTrace();
}finally{
try {
if( bufferedInputStream != null )
bufferedInputStream.close();
} catch (Exception exceptionFinally) {
exceptionFinally.printStackTrace();
logger.trace(Util_Client.INFO, Util_Client.getInfo(), "File download Ends.");
Thanks in advance
Edited by: sunRP on Oct 11, 2009 9:47 AMThe best you can do is set the correct content type.
Once the file reaches the client's browser it's up to the client and their browser settings to decide what to do with it.
You can't control the client's browser from your servlet. -
Peformance Turning for File Download / Upload with Enabled SharePoint Audit
Greetings all, may I ask your help for Peformance Issues?
Background:
I tried to create a ASP.NET Web Page to download/upload/list SharePoint file and deployed to IIS website in same application server (will NOT use web part as some users are NOT allowed to direct access confidential workspace)
Besides, for Audit Log record purpose, the page will impersonate (without password) the logged in user:
SPUserToken userToken = web.AllUsers[user].UserToken;
SPSite s = new SPSite(siteStr, userToken);
For File Listing, the web service can provide fast response, and we are using service A/C for connection (as no auting for listing, but require audit for file download upload)
Several implemeation options tested for File Downloiad / Upload, but issues occured and finding listed below:
Issues
1) SharePoint Object Model
When I open Site (using new SPSite), it's too slow to respond. (under 1s for all operations, but require 10~50s for open SPSIte. e.g.
using(SPSite s = new SPSite(siteStr) //50s
How can I download/upload file without open SPSite object (using SharePoint object model, but user token should be kept to allow SHarePoint identifiy user actions. e.g. Updated by Tom, NOT system administrator)?
2) SharePoint default web service
For file download, I tried to use SharePoint Web Service for download file, it's quick but how can SharePoint record the audit log to downloaded user, and not service A/C? ( e.g. View by Tom, NOT system administrator)
With Windows SSO solution, please note system should NOT prompt to ask user password for use impersonation
3) HTTP Request API (for file download)
As mentioned in point 2, if the system cannot get password from user, SharePoint also recorded service A/C in audit log... ><
Thank you for your kine attention.
.NET Beginner 3.5Thank you for prompt response, please find my reply with Underline:
Hi,
Maybe I'm not quite clear about the architecture you have now.
Is your asp.net application deployed in separate IIS site but in the same physical server as SharePoint?
Yes
"we are using service A/C for connection", can you please explain the 'A/C'?
Domain User, Local Admin and also SharePoint Service Admin A/C
Opening SPSite is relatively slower but shouldn't take 50 sec. However it depends on your server hardware configuration. You should meet the minimum hardware requirements for SharePoint.
Assigned double resources based on minimum hardware requirements.
For details, 50s is the load test result. But for other SharePoint operation, it takes around/under 3s reponse time.
Are you using SharePoint Audit log? Exactly If so then why don't you just put the hyperlink to the documents in your asp.net page. User maybe have to login once in SharePoint site but
it depends on your security architecture. For example if both of your sites in local intranet and you are using windows integrated authentication, SSO will work automatically User is NOT allowed
to access SharePoint site/server (not implemented for sepreate server yet, as performance issues occured for
separate site in same server) directly from Internet, the
middle server with web interface created for user request.
Whatever I understands gives me the feeling that you download the file using HTTPWebRequest C# class. However regarding security it depends on how authentication is setup in asp.net web site and in sharepoint. If both site uses windows integrated security
and they are in the same server, you can use the following code snippet:
using (WebClient webClient = new WebClient())
webClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
webClient.DownloadFile("file ur in sharepoint", "download directory");
Thanks, will try and reply later
But still, as I've mentioned, not quite clear about the whole architecture.
A) Request Handling
1) User use browser to request file listing and/or download file (hereafter called: File Download Request) from custom ASP.NET page (Let's say In Server 1, IIS 1)
2) ASP.NET page or File Handler ashx (Server 1, IIS 1) call custom web service, SharePoint deault/OOTB web service or using SharePoint Object Model to access SharePoint Document Library (in Server 1,
IIS 2)
3) Both SharePoint and IIS Web Site
(Server 1, IIS 1 & IIS2) using the same service A/C
4) The web service , File Handler return file obeject to IIS1
5) IIS 1 reply File Download Request to user
B) Application Architecture (In testing environment)
1) no load balancing
2) 1 DB server (Server 2)
3) 1 Application Server (with IIS 1 - ASP.NET, IIS 2, SharePoint Web Site with default SharePoint Web Service, IIS 3 SharePoint Admin Site & IIS 4 Custom SharePoint Web Service)
4) Sepreate AD Server (Server 3)
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com
.NET Beginner 3.5 -
types: begin of type_s_data,
record(65000) type c,
end of type_s_data.
data: w_xml_out type string.
data: t_xml_tab type table of type_s_data with header line,
Source code
t_code type table of type_s_data with header line,
After populating t_code table,
convert internal table data into XML document
call transformation id
source code = t_code[]
result xml w_xml_out.
append XML docu to internal table
append w_xml_out to t_xml_tab.
Download to XML file
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = filename
filetype = 'BIN'
append =
write_field_separator = sep
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
tables
data_tab = t_xml_tab
FIELDNAMES =
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22.
if sy-subrc <> 0.
message e016 with 'Error during file download'(002).
endif.
Problem here is when intrernal table data/size is large, only part of the data is getting displayed in the file and at the bottom of the file showing an error message
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
End element was missing the character '>'. Error processing resource 'file:///C:/Documents and Settings/sowjanya.suggula/De...
RECORD
^
>RECORD>
</item>
wehn i change data declaration as
data: t_xml_tab type table of string with header line.
when i execute the program, giving me a short dump.please suggest me a soluion for this.
Regards,
SowjanyaHi Sowjanya,
Kindly go through this link below:
It Uploads XML to internal table and vice versa :
Upload XML to internal table and vice versa in SAP 4.6C
Hope it helps
Regrds
Mansi -
Jar files downloaded from SkyDrive are being renamed to jar.zip files
I have cut and pasted the following series of exchanges from when I posted the problem onto SkyDrive's support forum. I hope that someone might be able to propose a better solution to the problem that I have. Thanks for your help.
MDSms asked on
Uploaded jar files convert to jar.zip files when downloaded from SkyDrive
I have uploaded an executable jar file to SkyDrive. (I will call this FILE.jar). The file is intact and indicates that it is a jar file type when the file is viewed by Properties within Skydrive. However, when I download (or others download through a share link) the file, it is being saved onto the local computer's download file with .zip appended to the file name (FILE.jar.zip). The downloaded file can be renamed to remove the .zip appendage and subsequently run successfully. However the folder options for the folder where the downloaded file resides must be changed for disable "Hide known file extensions" prior to being able to remove the .zip appendage. While I have figured out the workaround for this problem, this manual renaming procedure is entirely too cumbersome as a solution for sharing this file with others. How can I prevent or disable the FILE.jar file from being renamed to FILE.jar.zip when it is downloaded from SkyDrive?
All Replies (5)
Audrey_P. replied on
Forum Moderator
Hi,
Thank you for posting. Let me try to assist you with your issue with your files.
In order for us to reproduce the issue on our end. Please provide us with the exact steps that you did when you uploaded the files as well as the steps when you are downloading it.
We will be needing the steps to help us figure put what is causing you this issue.
We look forward to your response.
Thank you.
Audrey P.
MDSms replied on
Reply
The file was uploaded by first logging onto my SkyDrive account using Windows 7 Pro and Firefox browser, then a new folder in my account was created without sharing privileges, then the folder was opened and the FILE.jar was uploaded into the folder using the "Upload" option on skydrive account menu. Sharing privileges for FILE.jar were then created (view only), and the shortened url link was sent to the individuals that I was trying to share the file with. was then turned on. When these people use the link to download the file, it is being saved as FILE.jar.zip.
When I try to download the file through the skydrive account download option, it is being saved onto my computer as FILE.jar.zip and this occurs when I try to download the file while signed into my skydrive account as well as when I am not signed into my skydrive account (using the shared file link).
This PNG shows the information provided by clicking on the download icon (down arrow) within the Firefox browser; note that the file was downloaded as FILE.jar.zip and that the source was live.com. When I use Windows Explorer to look at the same file within the Download folder itself, examining the file's properties details also shows that it is being saved as FILE.jar.zip and is of the file type compressed zip folder.
This PNG shows the information displayed to me from my skydrive account when I view the originally uploaded file's properties; note that the information shows that the file is a jar file type.
When I utilize Internet Explorer 9 to access the file, FILE.jar is being downloaded onto my computer as a jar file type. This PNG shows the information provided by Tools/View Downloads within the IE9 browser. Note that in this instance, the information indicates that the file is being downloaded from yzudea.blu.livefilestore.com.
It appears to me that the problem (the FILE.jar file being renamed to FILE.jar.zip) arises from the fact that a jar file downloaded from skydrive using firefox, is being sent from live.com whereas a jar file downloaded from skydrive using IE9 is being sent from yzudea.blu.livefilestore.com.
I want to make sure that a person receiving a share link from me for FILE.jar is able to download it without modification to the file name regardless of which browser is being using to access the link. How can I make sure that this occurs?
Any help is appreciated. Thanks.
Michelle Anne D. replied on
Forum Moderator Community Star Community Star
Reply
Hi MDSms,
I appreciate you for providing as much information as you can about the issue, as well as for uploading screenshots on what you see from the downloaded file. About your initial concern wherein the file gets renamed with .zip after the original file extension, this is solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented.
Moreover, you may see the file servers live.com and yzudea.blu.livefilestore.com to be different with one another, but they actually are sent from the same SkyDrive server. This in turn, depends on the web browser where the file is being downloaded as well. The live.com file where it was downloaded from Firefox simply masks its original server yzudea.blu.livefilestore.com.
As for your last query about your recipients downloading the file without the hassle of renaming it from a .zip file, you can simply tell them to download it through Internet Explorer.
Should you have other queries or additional information that might help in our investigation, I highly encourage you to post them here.
Regards,
Michelle
MDSms replied on
Michelle,
Thanks for your reply. Yes, I could simply tell them to download the file through Internet Explorer, but is there another solution or workaround to the problem I have described here? Am I being punished with the curse of this problem simply because I (or the individuals with which I wish to share FILE.jar with) choose to use Firefox instead of IE? Will the use of any other browser instead of IE (Chrome, Safari, etc., etc.) still result in the same problem?
You stated that it is "solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented"........could the problem be overcome by designating one or both of the file server addresses as Trusted Sites within the browser options setting?
I look forward to your response. Thanks in advance.
Joy V. replied on
Forum Moderator Community Star Community Star
Reply
Hi MDSms,
We understand your concern. Since the issue does not occur in Internet Explorer, it has something to do with Firefox's security feature. You might want to verify this concern by contacting Firefox support.
Hope this helps. Let us know if we can further assist you with SkyDrive.
Thanks,
Melanie JoyTry to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
*http://kb.mozillazine.org/mimeTypes.rdf
*http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions -
File download using weblogic 6.1(Urgent)
Hi all,
Iam using weblogic 6.1 and wrote a code to download a file.
Previously when i used the same code , it worked properly in Tomcat but in weblogic it returns some junck values .
the same code is,
<%@page import="java.io.*,com.oreilly.servlet.*,javax.servlet.*;"%>
<%
ServletOutputStream outs = response.getOutputStream();
// Get the file to view
String file = "c:/ww-ww.xls";
// No file, nothing to view
if (file == null) {
out.println("No file to view");
return;
// Get and set the type of the file
response.setContentType("application/vnd.ms-excel");
// Return the file
try {
ServletUtils.returnFile(file, outs);
catch (FileNotFoundException e) {
out.println("File not found");
catch (IOException e) {
out.println("Problem sending file: " + e.getMessage());
%>
can anyone say whats the prob .
Thanx allhave u checked with the content type of weblogic.
as u r getting some chunks that means file has been send but been able
to display on client side.
problem must be with content type.
Maybe you are looking for
-
how to make a selection of a layer delete content and paste another content with Photoshop scripting..?
-
FIX: Zen Micro Installer Error - "DemoShield Player has encountered an error.
I just thought I'd post a solution to a problem I was having with the Zen Micro Explorer software installation because it might help someone else. Also, this forum is well indexed by search engines so it will be easy for people to find. It took me we
-
Help! Images not showing up in any browsers
I'm using Dreamweaver, and I can't get the images to show up in any browser--Safari, Firefox, or IE. In Dreamweaver, it worked in Safari, but now when I uploaded it, none. Please help, urgent!! http://geocities.com/snwboardnchic99/ I know it's probab
-
Randomly play single item from array?
Super rookie here to Flash. Is there some basic AS3 code to have, when the swf loads, a single video play from a collection of videos in an array? And can said code also apply to sound without video? I just found out the tutorial I was using to rando
-
Rewire was hanging Logic Pro 7 in Leopard!
Hey Guys, I just joined because I wanted to share my experience ... I upgraded my Logic machine to Leopard yesterday. Logic wouldn't open. I was ******! I read some of the threads that 7.2 would work. I was using 7.2.1. I reinstalled 7.2 and it would