Upload html files
Hello Team,
I followed the instructions in the how-to section to create a form to be able to upload and download files.
It works very good. However, it does not work for html files.
I have done that before using PL/SQL outside HTMLDB and I remember that this involved the creation of a table: ****PORTAL_CONTENTSPART which is equivalent in structure to the table WWV_FLOW_FILE_OBJECTS$PART.
So now how this table can be used to store HTML contents.
Thank you and appreciate your help in advance.
This is a modfied version of the code I used on AskTom.oracle.com. Should do the trick.
Create this table, it is pretty much a copy of wwv_flow_files
create table uploaded_files
(id number not null enable,
name varchar2(90),
pathid number,
filename varchar2(400),
title varchar2(255),
mime_type varchar2(48),
doc_size number,
dad_charset varchar2(128),
created_on date,
last_updated date,
content_type varchar2(128),
blob_content blob,
description varchar2(4000),
file_type varchar2(255),
file_charset varchar2(128),
constraint uploaded_files_pk primary key (id) enable
create index uploaded_files_idx1 on uploaded_files(filename)
This is the proecure used to download the files
create or replace procedure download_file (p_file in number)
as
v_mime varchar2(48);
v_length number;
v_file_name varchar2(2000);
lob_loc blob;
begin
select mime_type, blob_content,filename,dbms_lob.getlength(blob_content)
into v_mime,lob_loc,v_file_name,v_length
from uploaded_files
where id = p_file;
owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
htp.p('Content-length: ' || v_length);
-- 11/29/04 - Tyler just added this if statement to fix the download of html files
if v_mime != 'text/html' then
-- the filename will be used by the browser if the users does a save as
htp.p('Content-Disposition: attachment; filename=' || v_file_name || '');
end if;
owa_util.http_header_close;
wpg_docload.download_file( Lob_loc );
end download_file;
Grant execute on this file to public since the DAD connects as HTMLDB_PUBLIC_USER. You could just grant execute on it to that user if you like.
grant execute on download_file to public;
This is the process used to UPLOAD files. Assume it is on page 2 and you have 2 items: P2_FILE of type "File Browse" and P2_DESCRIPTION of type "Text Area".
declare
l_id number;
begin
-- After file upload, HTML DB sets the value of the
-- file upload item to the "name" of the file uploaded.
-- We'll use that to get the primary key of the file.
select id
into l_id
from wwv_flow_files
where name = :P2_FILE;
-- Copy the new row from wwv_flow_files into our own table (uploaded files)
insert into uploaded_files(
id,
NAME,
FILENAME,
TITLE,
MIME_TYPE,
DOC_SIZE,
DAD_CHARSET,
CREATED_ON,
LAST_UPDATED,
CONTENT_TYPE,
BLOB_CONTENT,
DESCRIPTION,
FILE_TYPE,
FILE_CHARSET)
select id,
NAME,
FILENAME,
TITLE,
MIME_TYPE,
DOC_SIZE,
DAD_CHARSET,
CREATED_ON,
LAST_UPDATED,
CONTENT_TYPE,
BLOB_CONTENT,
DESCRIPTION,
FILE_TYPE,
FILE_CHARSET
from wwv_flow_files
where name = :P2_FILE;
-- Set the description = to the description from the item on our page.
-- You could do this in the insert, but I broke it out to make it more
-- readable.
update uploaded_files set description = :P2_DESCRIPTION where id = l_id;
-- Delete the new file from wwv_flow_files since we now have it in our
-- own table
delete from wwv_flow_files where id = l_id;
end;
This is the report used to display your files. I would put it on a different page than the upload page.
select ''||filename||'' link1,
description,
case when doc_size < 102.4
then round(doc_size,1)||'b'
when doc_size < 1048576
then round((doc_size/1024),1)||'kb'
else round((doc_size/1024/1024),1)||'mb'
end the_size,
mime_type,
created_on
from uploaded_files fHope this helps,
Tyler
Similar Messages
-
Powershell, design manager, uploading html file not creating associated master page file
I am uploading a xyz.html file through powershell for 2 site collections, when .html file is uploaded and published it automatically creates xyz.master file. It is working fine for not publishing sites collection only, for publishing site collection .html file
is uploaded successfully but it is not creating associated .master file. If I close powershell console and run again it works successfully.
another interesting thing I noticed that if I specify "spadmin" account which I used to install sharepoint as site collection primary administrator, all works well, currently I am using "spsiteCollection" account for primary site collection
administrator and I am having above mentioned issue.
powershell script is also running with spadmin account.
I have ensured .html is checked in and publish properly, If I manually unpublish and publish .html file it creates .mater file. What could be the issue?Hi,
According to your post, my understanding is that you have an issue about upload html file to master page gallery.
I have used the PowerShell contains in the codeplex to upload the files to master page gallery, it works without any issue.
https://uploadmasterpages.codeplex.com/
You can check your PowerShell with this article, or use this bat file to upload directly to check whether it works.
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jason Guo
TechNet Community Support -
How to upload html file document with his.files
i can upload only one file and i can't upload html file with his images or some more pages
index.html
chapter1.html
chapterN.html
I see this problem so: upload zip file and extract to os(i use linux) and saved link to his index.html.
IS IT POSSIBLE.
Thanks.
Sorry for my english.The simplest way to handle this would be to Upload the page and files to a remote server space and send your email buddies a link to the site. Barring that....
How to Code HTML Emails
http://www.sitepoint.com/article/code-html-email-newsletters/
Use inline CSS styles for fonts and background colors. Use Tables to hold your page elements. Use absolute URLs to images hosted on your web server because attached images may not get through. Give people who can't see your HTML page in their email client a link to the HTML page on your web server.
Download some HTML Email Templates from the links below to help you get started.
Mail Chimp
http://www.mailchimp.com/resources/html_email_templates/
Constant Contact
http://www.constantcontact.com/email-marketing/html-email-templates/index.jsp
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
How to upload html file to email
Hi,
I have absolutely no html background but was able to come up with a single page layout with graphics, texts and links with the help of online tutorials using Adobe Go Live which I can open the file now in Dreamweaver.
My goal is not to come up with a webpage in cyberspace but to create an html file with images and links to specific websites that can be emailed to people. The file must be part of the email body that people can readily view the images, texts and click the links right away and not to be as an attachment.
Would appreciate it very much if someone can help me out.
Thanks.
NewbieThe simplest way to handle this would be to Upload the page and files to a remote server space and send your email buddies a link to the site. Barring that....
How to Code HTML Emails
http://www.sitepoint.com/article/code-html-email-newsletters/
Use inline CSS styles for fonts and background colors. Use Tables to hold your page elements. Use absolute URLs to images hosted on your web server because attached images may not get through. Give people who can't see your HTML page in their email client a link to the HTML page on your web server.
Download some HTML Email Templates from the links below to help you get started.
Mail Chimp
http://www.mailchimp.com/resources/html_email_templates/
Constant Contact
http://www.constantcontact.com/email-marketing/html-email-templates/index.jsp
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
How to upload html files using Weblogic Bulkloader
I hav uploaded image files using bulkloader.
however with html files am facing a prob.
only the file structure gets created but there is no html file present inside.
in
Filename.html.md.properties i agv the followin
nodeType=html
lifecyclestatus=2
File=C:\ContentRepository\a.html
encoding=UTF-8
charset=us-ascii
mimeType = text/html
shud i add some more properties...You have to do this your self by either (as vinod said) using a different component (not present in adf) or implementing this:
1) allow the user to select multiple filenames (somehow)
2) zip them together
3) upload the zip
4) unpack the zip on the server
5) work with the files
Timo -
Uploading html files with .swf files in them
I created a website and published it in Flash. I then used
Dreamweaver to create the HTML file that I would upload to my
server. But, when I go to my site, the .swf file does not load.
Both the HTML file and the .swf file were uploaded using an
FTP client, so I don't know why it's not showing up.Don't know if this will fix it for you but when we went
through this we had to tell the server to allow .fla, .swf and .flv
files. Until we did this it didn't show the flash part of the
website. -
Wiki Server uploading HTML file + related archives
Hello,
I am using Wiki Server to store content of our Lego Robotics training center oriented to childs. We use Lego Digital Designer (LDD) to create Lego models. LDD creates a kind of assembly instrucctions manual in HTML format. This file gets images from a folder created at the same time of the .html file by LDD. My intention is to upload the whole thing (html + archives) to the Wiki in order to properly organize the content to be used by the students.
I do not have HTML knowledge and have been struggling with all that for a while and can't find a way. Is it possible? if positive (I hope...) how?
Thanks!
RafaelHi,
Try downloading the file from application server using the transaction CG3Y, while saving the file, save as HTML file.
Still if you find the formatting error, then open the view -> source code of the HTML page, and adjust the space, line space, alignment etc if any, will resolve your issue.
Regards,
Santhosh. -
Error Encountered while uploading HTML, PDF files via WEBUI and IFS API
Hello:
We have suddenly run into problems while using IFS to upload files. We cannot seem to upload html and pdf files using either the WEBUI or Oracle's IFS API. However we are able to add .gif, jpeg files both via the WEBUI and Oracles IFS API's
This is the error we get while trying to upload .html files via the WEBUI
IFS-30002: Unable to create new Library Object.
This is the stack trace we get when we try creating content objects via IFS API's. We can't seem to understand why something that used to work has suddenly quit working.
Does this have anything to do with running out of space requirements in the table spaces?
oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject oracle.ifs.common.IfsException: IFS-32251: SQL Error inserting index entry into ODMZ_CONTEXT_ROUTER java.sql.SQLException: ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
ORA-01410: invalid ROWID
ORA-01410: invalid ROWID
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:862)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1846)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1771)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2361)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:422)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:487)
at oracle.ifs.server.S_LibrarySession.execute(S_LibrarySession.java:14319)
at oracle.ifs.server.S_Media.insertIntoContextRouter(S_Media.java:2473)
at oracle.ifs.server.S_Media.postSetContent(S_Media.java:2440)
at oracle.ifs.server.S_Media.setContent(S_Media.java:1699)
at oracle.ifs.server.S_ContentObject.setContent(S_ContentObject.java:399)
at oracle.ifs.server.S_ContentObject.extendedPreInsert(S_ContentObject.java:236)
at oracle.ifs.server.S_LibraryObject.preInsert(S_LibraryObject.java:1644)
at oracle.ifs.server.S_LibraryObject.createInstance(S_LibraryObject.java:2711)
at oracle.ifs.server.S_LibrarySession.createSystemObjectInstance(S_LibrarySession.java:8128)
at oracle.ifs.server.S_Document.setContentObject(S_Document.java:475)
at oracle.ifs.server.S_Document.extendedPreInsert(S_Document.java:313)
at oracle.ifs.server.S_LibraryObject.preInsert(S_LibraryObject.java:1644)
at oracle.ifs.server.S_LibraryObject.createInstance(S_LibraryObject.java:2711)
at oracle.ifs.server.S_LibrarySession.newLibraryObject(S_LibrarySession.java:7922)
at oracle.ifs.server.S_LibrarySession.newPublicObject(S_LibrarySession.java:7963)
at oracle.ifs.server.S_LibrarySession.newPublicObject(S_LibrarySession.java:7945)
at oracle.ifs.server.S_LibrarySession.DMNewPublicObject(S_LibrarySession.java:7604)
at oracle.ifs.beans.LibrarySession.DMNewPublicObject(LibrarySession.java:7898)
at oracle.ifs.beans.LibrarySession.NewPublicObject(LibrarySession.java:5342)
at oracle.ifs.beans.LibrarySession.createPublicObject(LibrarySession.java:2969)
at ORG.oclc.da.utilities.ifs.IfsDocumentUtility.createDocumentDefinition(IfsDocumentUtility.java:238)
at ORG.oclc.da.utilities.ifs.IfsDocumentUtility.createHTML(IfsDocumentUtility.java:133)
at ORG.oclc.da.utilities.ifs.IfsDocumentUtility.createDocument(IfsDocumentUtility.java:89)
at ORG.oclc.da.chs.userinterface.CHSProcessListener.download(CHSProcessListener.java:1043)
at ORG.oclc.da.chs.core.Spider.download(Spider.java:605)
at ORG.oclc.da.chs.core.CHSTest_raj.main(CHSTest_raj.java:145)
Any help on this front is appreciated.
thanks
Mathangitry this code, it works fine for me:
<%@ page import="java.io.*"%>
<%
String name = "C:/temp/EURO_Weekly_wk01-10-26.pdf";
try
InputStream in = new FileInputStream(name);
int n = 0;
//read the file from the input stream to the byte buffer
out.clear();
response.setContentType("application/pdf");
while( (n=in.read()) != -1)
out.write (n);
out.close();
catch (IOException ioe) {
out.println ("io error: " + ioe.getMessage());
return;
%> -
hi all.
i have a little problem:
i upload html file in portal and it is look like this
http://your:port/pls/mydocs/mydocs.content_pkg.download?p_file=F920058486/index.shtml
if i clicked on inside ref i see eror
The requested URL /pls/mydocs/index.shtml was not found on this server.
i know why:
inside refs in this file look like this
http://your:port/pls/mydocs/index.shtml#1
http://your:port/pls/mydocs/index.shtml#2...
but inside refs should be
http://your:port/pls/mydocs/mydocs.content_pkg.download?p_file=F920058486/index.shtml#1
i don't know how to do it.
thanksJason
If you need to use xmodem then there is probably more to this situation than you have told us so far. Knowing more of the background might help us to give you better advice.
I doubt that you will be able to successfully use xmodem to copy files which would support HTML and the Web Console. If you are using xmodem then you are almost certainly copying a bin file. If that copy is successful it should allow you to use the command line for access. And through the archive command you can copy the tar file and install the HTML files to use the Web Console.
HTH
Rick -
URGENT: Is it possible to upload multiple files using STRUTS
Hi,
Is it possible to upload multiple files using STRUTS.
I am able to upload a single file. But how do i upload multiple files ??
upload.jsp
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
<title>New Page 1</title>
</head>
<body>
<html:form action="/secure/uploadFile.do" enctype="multipart/form-data" method="POST" type="com.smartstream.webconnect.user.actions.UploadActionForm">
<p>File to upload
<html:file property="fileUpload" size="20"/></p>
<p><html:submit/></p>
</html:form>
</body>
</html:html>
UploadAction.java
public class UploadAction extends BaseAction {
Logger log = Logger.getLogger(AttachMessageAction.class);
public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ActionException {
System.out.println("executeAction of UploadAction");
UploadActionForm uploadActionForm = (UploadActionForm) form;
int fileSize = uploadActionForm.getFileUpload().getFileSize();
System.out.println("uploadActionForm.getFileUpload().getFileSize() = " + uploadActionForm.getFileUpload().getFileSize());
byte buffer[] = new byte[1024];
try {
BufferedInputStream bufferedInputStream = new BufferedInputStream(uploadActionForm.getFileUpload().getInputStream());
FileOutputStream fos = new FileOutputStream("s:\\uploaded\\" + uploadActionForm.getFileUpload().getFileName());
int read;
while ( (read = bufferedInputStream.read(buffer,0,buffer.length)) != -1) {
fos.write(buffer, 0, read);
fos.flush();
fos.close();
bufferedInputStream.close();
return mapping.findForward("success");
} catch (IOException e) {
e.printStackTrace();
return mapping.findForward("error");
}catch(OutOfMemoryError o){
o.printStackTrace();
System.out.println("o.getMessage() " + o.getMessage());
return mapping.findForward("error");
UploadActionForm.java
public class UploadActionForm extends ActionForm{
private FormFile fileUpload;
private byte[] fileContent;
public FormFile getFileUpload() {
org.apache.struts.taglib.html.FormTag _jspx_th_html_form_0;
return fileUpload;
public byte[] getFileContent() {
return fileContent;
public void setFileUpload(FormFile fileUpload) {
this.fileUpload = fileUpload;
public void setFileContent(byte[] fileContent) {
this.fileContent = fileContent;
}--Bhupendra MahajanYes, you could try using the multipart handler...
But I have a better idea...
Determine the maximum number of file uploads that the
user can do at one time. I mean, you can't
realistically have the user upload a million files at
one time. So say the max is 20. So you create your
action form class with 20 FormFile fields called file1
to file20.
Then when you dynamically create your page, you
dynamically create the specified number of file fields
and 1 hidden field called "totalFiles" which contains
the number of file fields you created. This should be
an int field in the form bean.
Then when you do your action processing, you just loop
thru the totalFiles... Or well, actually, you may not
need that at all. You could just check all the
FormFile fields and whatever ones aren't null contain
files.But what about UploadActionForm.java[b]
How do i have exact mapping of the HTML form in this file ??
--[b]Bhupendra Mahajan -
HTML File Upload - using DAD - Error
I have set up my document table, the document upload package is in there, but my HTML for the file upload is not working correctly:
DAD info
DAD Name: /pls/portal
Document Table: dw_target.documents
Document Access Procedure: document_api.download
here is the upload HTML:
<html>
<head>
<title>test upload</title>
</head>
<body>
<form enctype="multipart/form-data" action="http://MYURL:7777/portal/pls/portal/dw_target.document_api.download" method="post">
File to upload: <input type="file" name="file"><br>
<input type="submit" value="Upload">
</form>
</body>
</html>
But i get this error when i try to upload a doc:
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
anyone have any insight on how to get the file upload to work (specifically how to configure the HTML to correctly use the upload process?
using Oracle App Server 10g
jasonPschar,
What is "dw_target.documents"?
Joel -
Unable to upload/download large html files(71 MB) into rooms
Hi,
I am unable to upload download HTML file(71 MB)into folders of collabration rooms.if it is uploaded also its getting Scripted/corrupted.
other files are working properly.
Is it because of large size or any other configuration settings.there is no error msg buts its getting scripted.
Waiting for your response
Thanks
Amit kumar KoyalHi Kerstin,
the note also says: "This restriction is no longer valid".
With SP19 I do run tests continously that test content up to 2GB.
Amit: What portal version are you running? What repository implementation is the file stored in? If the file is stored in a file system, what is it's file size limitation?
Regards,
Michael -
How to upload a file with a HTML form into a BLOB ?
Hi,
I want to upload a file into a BLOB.
I have created a procedure in PL/SQL whitch generates an html form.
You can upload a file with <input type="file" name="my_file">.
How can I insert this file into my database ?
Thank's for your Help
EstelleHi Estelle,
Portal Applications forum is a more apporpriate forum for such questions. Please post your question there.
Thanks,
Ravi -
How to upload an html file using jsp and jdbc
Hi,
im trying to upload an html page using JSP and jdbc. but of no success.
my aim is to keep some important html pages in the database.the file size can vary.the file has to be selected from a local machine (through the browser) and uploaded to a remote machine(where the databse resides).
any help/sample code or pointer to any helpful link is appreciated.
thanks in advance
javajar2003When uploading a file, I use a byte array as a temporary buffer..
So, you should then be able to store the byte array in the
database as binary data.
example>
//Temporary Buffer To Store File
byte[] tmpbuffer = new byte[860];
//Some Code To Upload File...
//File Should Now Be In Byte Array
//Get DB Connection and execute Prepared Statement
Connection con=//GET DB CONNECTION;
String sql=insert into TABLE(page) values(?);
PreparedStatement ps=con.prepareStatement(sql);
ps.setBytes(1,tempbuffer);
ps.executeUpdate();
//Close PS and Free DB Connection
..... and this method looks like you dont even have
to store the file in a byte array, you can just give
it the input stream.
ps.setBinaryStream(int, inputStream, int);
You may have to make several attempts at this. I have
uploaded a file and temporarily stored it in a byte array,
but have never from there stored it in the DB as binary
data.. but this looks like it'll work.
Good Luck! -
Cannot upload application with HTML files
<loader version="1.0">
<application id="GuideBook">
<name>GuideBook</name>
<description>Know your rights</description>
<version >1.0</version>
<vendor></vendor>
<copyright>Copyright (c) 2009</copyright>
<fileset Java="1.0">
<directory>D:\Projects\Blackberry\SampleApplications\phonegap\</directory>
<files>GuideBook.cod</files>
</fileset>
</application>
</loader>
Try to upload application on device Blackbarry 7100, but allways get error
"The application GuideBook cannot ge loaded because some required files are not available."
But D:\Projects\Blackberry\SampleApplications\phonegap\GuideBook.cod exists ! Yes, my application uses HTML files, maybe i need to add them also?Thanks for your fast reply. My fast answer is:
Strange things
1. I tried to connect to htmldb as you asked me. It was OK from localhost and remote computer, too.
2. WEB folder experimenting wasn't successful from local computer again, BUT IT WAS SUCCESSFUL (via XDB login) FROM REMOTE COMPUTER. (I haven't tried it yet before...)
I have read the information you wrote about DAD some days ago, and I found it valuable. The only different thing in XE (after you restore the pls dad) is the user.package.procedure calling INSIDE the package, which - as I understand - is a new thing. Eg. calling from one procedure from the other in package test in 9i was simple: test.procedure1. But now you HAVE TO put username at the beginning of the calling, like: hr.test.procedure1 which means that you can compile the old package without error, however you cannot use the procedure calling inside the package. That is the reason I had to change them. Another new thing, that if you want to share your http package, that you have to add an execute grant on it to public. So there are some differences, not big, nevertheless important changing.
After this long dissertation, my question is still how can I reach an image folder from my package. Now I can reach the WEB folder from an old NT4 machine, so I can upload and download images, making folders, etc. But how can I reference them? (Anyway I do not now the reason, why I cannot reach WEB folder from the local computer...)
Sorry for the long long long spiel. Waiting for your answer.
Zsolt
Maybe you are looking for
-
Using Aperture 3 with two computers
I have a Imac and a macbook and I have aperature 3 library installed on a firewire hard drive and the application on both computers fully updated. I thought when I did that that anything I did on my imac would be available on my macbook and visa ve
-
24" iMac not recognizing internal hard drive..
end of '07 iMac 24" 2.4GHz I have been having problems with this iMac since day 1... I'm kind of fed up with it at this point BUT I would like to get it working at least. PROBLEM: Yesterday I was working on the ol' iMac and I walked away, the compute
-
How to disable a downloaded pdf openned by Acrobat automatically?
Hi,guys, How to disable a downloaded pdf openned by Acrobat automatically? Thanks.
-
Hi, I have got three ipad minis which I would like to use in a business environment whereby the users can see and update a single calender. Is this possible? Would they have to be run form one account?
-
Photo quality change after exporting
Hello I'm working on a short film project that should be made from photos not videos (so photos are critical in this iMovie project), but after exporting the movie ( in HD) I found out that the photos' quality were reduced? Most of the photos are dar