Ramesh Bhagasra

Greenhorn
+ Follow
since Nov 21, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ramesh Bhagasra

I am able to see the blob contents in the client window but the file does not show as attachment which is my main purpose-- to give the user the option either to open the file or to save the file on his machine. I am also setting the setHeader as attachment , but nothing happens....and sometimes it shows a dialog box to open my jsp file itself rather than the desired file... sending you the code ..please help
File file1 = new File("c:\\Test.java");
byte[] buffer = new byte[(int)file1.length()];
BufferedInputStream is = new BufferedInputStream(new FileInputStream(file1));
is.read(buffer, 0, (int)file1.length());
is.close();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write(buffer, 0, (int)file1.length());
System.out.println(baos.toString());
byte[] pass = baos.toByteArray();
response.setHeader("Content-Desposition", "attachment;filename=untitled.java");
response.setContentType("application/octet-stream");
//Send content to Browser
ServletOutputStream servletOut = response.getOutputStream();
servletOut.write(pass);
servletOut.close();
20 years ago
JSP
I want to display the blob contents in the clients window and give him the option either to open or save the contents. I am able to read the contents from Oracle Blob Field and stored the contents in the ByteArrayOutputStream object but I am not able to open the contents for the client. I am using the following code
Blob blob = resultSet.getBlob(1);
int length = (int)blob.length();
byte [] b = blob.getBytes(1, length );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write(b,0,length);
response.setHeader("Content-Disposition","attachment; filename="+baos );
Please help me
20 years ago
JSP
I am facing problem in submitting the form through JavaScript, i have done it earlier also but this time its not working, it says an error like Object does not support this property or method.. I am using the following code:
document.myForm.dnld.value=i;
//document.myForm.submit();
document.myForm.action="upload.jsp?dnld="+i;
document.forms[0].submit();
Please help me
Hi guys
I have to show a file to the client using the browser, I have the file contents stored in my Blob Field in the Database. Now I want to display the file on clilck of a button called DOWNLOAD and then determine the type of file, correspondingly setting the contentType and setHeader of response object. How can i do that??? Please help me at ur earliest...
Thanx
20 years ago
JSP
cant find the package javax.servlet.*;
cant compile the java code because of this. please help me out..i have already searched out the src.zip to locate javax.servlet package. but javax folder exists but the servelet inside javax does not. please help at ur earliest..
20 years ago
JSP
hi there i m trying very hard to display the contents of a pdf file whcih is stored in my oracle table as a blob field, but i m not able to stream it out through response object. i have tried everything..plzzzz help me out...
20 years ago
JSP
can u give me some code idea for that and plz tell me can i use servlet as a bean in my jsp using usebean tag
20 years ago
JSP
I want to display the pdf file contents to the web page through jsp. Currently i am trying to it using response object and setting its content type to application/pdf but the explorer does not show any output. what i have to do for initialising the pdf application and displaying the contents stored in my oracle databse as blob field. Please help me out........
20 years ago
JSP