File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes File Download Problem:GIF,DOC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "File Download Problem:GIF,DOC" Watch "File Download Problem:GIF,DOC" New topic

File Download Problem:GIF,DOC

roul ravashimka
Ranch Hand

Joined: Mar 16, 2004
Posts: 53
Hello JavaRanchers,
i've got a problem when i download gifs,docs,..
it works well for pdf,zip,txt,mp3,html
but not for gifs,jpegs,avis,docs.
my code is:
<%@ page language="java" %>
response.setHeader("Content-Disposition","attachment; filename=\""+ request.getAttribute("filename") + "\""); fileInputStream = new"c:\\uploads\\"+(String)request.getAttribute("fileid"));
int i;
while((!= -1){
Is ther a difference between a pdf(which works) and a gif(which doesnt worok)?
Or do i have to use other streams?

MSc Electronics, ICT
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63841

"Roul rv",
We're pleased to have you here with us in the JSP forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: File Download Problem:GIF,DOC
It's not a secret anymore!