Re: Upload and download blob files into the DB using OAS

From: temp <temp013_at_hotmail.com>
Date: Thu, 27 May 1999 19:08:21 +0800
Message-ID: <7ij935$5p1$1_at_news.cowan.edu.au>


To download files, have a procedure like: create procedure download (filex in varchar2) as begin
 htp.download_file(filex);
end;

and call it from a html page like
<HTML>
<HEAD>
<TITLE>Download File</TITLE>
</HEAD>
<BODY bgcolor="white">
<h2>Download Files</h2>

<FORM action="/ml3/plsql/download" method="POST">

<p>Select file to download
<p>
<SELECT name="filex" size=5>
<option value="file1">file1</option>
<option value="file2">file2</option>
<option value="file3">file3</option>
<option value="file4">file4</option>
<option value="file5">file5</option>
<option value="file6">file6</option>
<option value="file7">file7</option>
<option value="file8">file8</option>
</select>

<p>
<INPUT type="submit">

</FORM>
<p> end of form
</BODY>
</HTML>

To upload, have a procedure like
create procedure write_info (
 who in varchar2,
 description in varchar2,
 file in varchar2) as
begin
 insert into myTable values (who, description, file);

 htp.html.open;
 htp.headopen;
 htp.title('File Uploaded');
 htp.headclose;
 htp.bodyopen;
 htp.header(1, 'Upload Status');
 htp.print('Uploaded ' ||file|| 'successfully');
 htp.bodyclose;
 htp.htmlclose;

end;

and a html file like
<HTML>
<HEAD>
<TITLE>Upload File</TITLE>
</HEAD>
<BODY>
<p> start form
<FORM

 enctype="multipart/form-data"
 action="/sample/plsql/write_info"
 method="POST">

<p>Who:
<INPUT type="text" name="who">

<Description:
<INPUT type="text" name="description"><br>

<p>File to Upload:
<INPUT type="file" name="file"> <br>

<p>
<INPUT type="submit">

</FORM>
<p> end of form
</BODY>
</HTML>

Good luck

Narasimha Kasibhatla (KN) wrote in message <374ADB8F.42D0_at_pg.com>...

>Hello:
>I need to upload and download files into the oracle 8 database. The OAS
>4.0 developer's guide seems to indicate that uploading files is
>possible. I would like to upload and download blobs into the database
[Quoted] >using the OAS. Has anyone done this? Is this possible without using some
>sort of a CGI script?
>
>
>Thanks,
>
>
>Narasimha
Received on Thu May 27 1999 - 13:08:21 CEST

Original text of this message