[Zope] Content Disposition - Download files

2006-06-26 Thread Bruno Grampa
Hello,
i want to send an image or a pdf  to a browser not for viewing but for
downloading.
I've written this code:
dtml-call RESPONSE.setHeader('Content-type',
'application/force-download')
dtml-call RESPONSE.setHeader('Content-Disposition', 'attachment;
filename=filename.gif')

now i have to send the file as a binary flow, but i don't know how to
do. Can you help me?

Thanks,
Bruno



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Content Disposition - Download files

2006-06-26 Thread Bruno Grampa
Hello,
 i want to send an image or a pdf  to a browser not for viewing but for
 downloading.
 I've written this code:
 dtml-call RESPONSE.setHeader('Content-type',
 'application/force-download')
 dtml-call RESPONSE.setHeader('Content-Disposition', 'attachment;
 filename=filename.gif')

 now i have to send the file as a binary flow, but i don't know how to
 do. Can you help me?
 Do you plan to always send the file for download?
 Then you just put a script name into precondition
 field of the object. The script could be something
 like:

 (Python script)

 context.REQUEST.RESPONSE.setHeader('Content-Disposition','attachment;
 filename=%s' % context.getId())
Nice idea, but what i need is different. In PHP there is a function
called readfile, i'm sure there is something also in Zope, but i'm not
able to find it!

Thanks,
Bruno

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Problem with ExtFile

2006-03-29 Thread Bruno Grampa

Hello,
i've a problem with ExtFile 1.4.4 installed in a Zope 2.8.6 (on RHES4).
The redirection, at the end of file creation doesn't work.
To test the problem you have to create these methods:
The first one is called 'form':
---
dtml-var standard_html_header

form action=write method=post enctype=multipart/form-data 
name=form1

p
Insert
p
Id input type=text name=idbr
bFile/binput type=file name=file value=
br

input type=submit value=Send
/form

dtml-var standard_html_footer
---

The second one is called 'write':
---
dtml-comment
dtml-call 
manage_addProduct['ExtFile'].manage_addExtFile(id=REQUEST['id'],title='',descr='',file=REQUEST['file'],content_type='', 
permission_check=0)

/dtml-comment
dtml-call 
manage_addProduct['ExtFile'].manage_addExtImage(id=REQUEST['id'],title='',descr='',file=REQUEST['file'],content_type='',create_prev=1, 
maxx='100', maxy='100', ratio=1, permission_check=0) 


dtml-var standard_html_header

Ok, done.

dtml-var standard_html_footer
---

If i use manage_addExtImage i got the Ok, done message; if i use 
manage_addExtFile no, just a piece of page (junk?).


I can't understand why, can someone help me?

Thanks!
   Bruno


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Progress bar for file upload

2006-02-12 Thread Bruno Grampa

Hello,
what is the better way to implement a simple progress bar when uploading 
a file in Zope?


Thanks (also for all the answers, hints and tips i've received from this 
wonderful community in the past times!)

   Bruno

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Javascript rendering problem?

2006-02-01 Thread Bruno Grampa

Hello,
i've what i think is a rendering problem checked on Zope 2.8.5 and Zope 
2.9 (tried on unix and windows os):
download from microsoft website the sdk for Windows Media Center 
(http://www.microsoft.com/windowsxp/mediacenter/developer/default.mspx). 
Inside there is a folder called HTML Templates. There you can find some 
html pages designed to be seen on media center. You can normally view 
them using IE. Now transfer the entire directory inside Zope; if you 
open the default.htm files the highlight of buttons and objects is not 
anymore working. IE doesn't complain about any errors, it just don't 
work. I've tried uploading the same directory to Apache and pages are 
working. These files are full of javascript but i really can't 
understand what's happening.


Thanks,
   Bruno



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Precondition on images saved in a localfs folder

2006-01-10 Thread Bruno Grampa

Hello,
if i upload an image in the ZOBD as a file i have the precondition if i 
do the same in the localfs folder no. Do you know why?

It seems LocalFs will always recognise the file uploaded as an image...

Thanks,
Bruno

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Help me!

2006-01-09 Thread Bruno Grampa

Hello,
i'm building a site to sell images (this is the concept, the reality is
different...).
All the images are in a directory mapped through LocalFS product.
For every image i have a record in a SQL table with all the basic
informations: author, name of the file, cost.

What i haven't understood is how to block users from getting images if
they have not enough credit to buy them.
I need to control the view method, but i don't know if this idea is the
right one or there are better solutions.

Any hints?

Thanks,
   Bruno


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )