cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <ajuf...@sun3.oulu.fi>
Subject File dowloading
Date Fri, 03 Jan 2003 13:27:41 GMT
Hi,

I am having some trouble with the following. I want users to be able to 
download some zip (or any type) files. So, I have put in the sitemap the 
following:

<map:match pattern="course-material/**.zip">
   <map:act type="action-retrieve-lecture-notes">
     <map:read type="resource" src="LectureNotes/{../1}.zip" 
mime-type="application/zip" />
   </map:act>
   <map:redirect-to uri="../lecture-notes" />
</map:match>

The action simply checks if the user is allowed to access the zip files. 
  And if not, the user is being redirected to a login page 
(../lecture-notes). The login form makes use of the same action 
(action-retrieve-lecture-notes); this action ensures also that the user 
is pointed to the appropriate file that is to be downloaded (and this 
depends on some login information, including some course id).

All this works quite nicely, except that the <map:read> does not really 
start up a download process. That is, it causes all the steps 
necessarily and the user is being asked what to do with the file (save 
it, open it, etc) like any other download process, but the file that is 
being downloaded has a file size of zero. But the file that is accessed 
locally is the correct one: I have checked the cocoon log files. There 
is no problem with the file itself (I have placed it into a publically 
accessible location served directly by the Apache webserver and had no 
problems with downloading the file.)

So what to do? I was thinking that it is maybe some caching issue. Some 
of the files to be downloaded can be fairly large (there is one file of 
about 20 Mb).

I am using cocoon-2.0.2-dev, java k1.4.0_01 and Tomcat 4.0.4.

Thanks for any help.

-- 
Andre H. Juffer              | Phone: +358-8-553 1683
The Biocenter and            | Fax: +358-8-553-1141
     the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
University of Oulu, Finland  | WWW: http://www.biochem.oulu.fi/Biocomputing/


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message