473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[CherryPy]Serve dynamic binary file in cherrypy?

mep
Hi,
After lookup in cherrypy site and google for a while, I haven't
found any information about cherrypy how to serve dynamic binary
file(some generated charts).Is there any easy way to do this?
In cherrypy 2.0 & python 2.4

--
Best Regards,
Wang Kebo

http://www.huihoo.org/~mep
Jul 18 '05 #1
2 4261
mep
Resolved. Simplely specifiy content mime type before return.
--
Best Regards,
Wang Kebo

http://www.huihoo.org/~mep
"mep" <me**@163.com > wrote in message news:39******** *****@individua l.net...
Hi,
After lookup in cherrypy site and google for a while, I haven't
found any information about cherrypy how to serve dynamic binary
file(some generated charts).Is there any easy way to do this?
In cherrypy 2.0 & python 2.4

--
Best Regards,
Wang Kebo

http://www.huihoo.org/~mep

Jul 18 '05 #2
"mep" <me**@163.com > wrote in message news:<39******* ******@individu al.net>...
Hi,
After lookup in cherrypy site and google for a while, I haven't
found any information about cherrypy how to serve dynamic binary
file(some generated charts).Is there any easy way to do this?
In cherrypy 2.0 & python 2.4


Yes, there is an easy way: have your handler method return the binary
data, and set the Content-Type before returning the data, like this:

# class Root:
# def index(self):
# ... Generate binary data in "data" ...
# cpg.response.he aderMap['Content-Type'] = 'image/gif'
# return data

Remi.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
3518
by: Charlotte | last post by:
I am developing a web application and am looking for the best framework to do this in. I know this is an old question, and I have read the list archives and a couple of comparison pages on the web. I played around with some, and I have reduced my choices to two very different frameworks: cherrypy+cheetah and twisted+nevow. I am writing the prototype in cherrypy with cheetah, and I like it very much. I am very impressed with the speed of...
6
1405
by: Bill Mill | last post by:
On my laptop, I have an NTFS partition for NT, a FAT partition for data as a dmz which both linux and NT can access, and an ext3 partition for linux. However, I've experienced some weirdness on the FAT partition, and I'm wondering if anybody can tell me why it's happening. Yesterday, I downloaded the new release of cherrypy, and stuck it on the dmz drive. I ran tutorial01, which opens up a server on port 8080 and waits for connections....
0
1158
by: infidel | last post by:
I have just recently discovered CherryPy and Kid (many kudos to the respective developers!) and am tinkering with them to see what I can come up with. The application I eventually want to write will eventually require the python code to call stored procedures in a database which means I'll need to run CherryPy with a threadPool so individual database calls don't block the whole server. I'm not to that point yet, I'm just getting a...
2
2128
by: infidel | last post by:
I've been trying to get my CherryPy server to authenticate users against our network. I've managed to cobble together a simple function that uses our LDAP server to validate the username and password entered by the user: # ldap.py from win32com.client import GetObject ADS_SECURE_AUTHENTICATION = 1
4
1837
by: Mr BigSmoke | last post by:
Hi All, I'm developing a website to handle some code/application version control on a intranet. I'm using cherrypy and pysvn. Everything runs quite good but i want the user to be able to checkout some projects from the server. The user(on the client side) selects a folder in his machine (i.e.: C:\Project1) and the server should checkout (download/copy) all the project selected to the client machine. But what happens is that the webserver...
0
1214
by: Thomas McLean | last post by:
Hi all, First post to the list, so first off, I'm new to Python and everything surrounding it so if you can please ignore my ignorance. I setup a cherryPY server so that I could use sabnzbd but once, I have installed/configured what I was told by the tutorials and everything else. I run ubuntu x86 dapper FYI. The error messages I get from the logs are as follows (which don't really
10
4948
by: Vincent Delporte | last post by:
Hi I'm still a newbie when it comes to web applications, so would like some help in choosing a solution to write apps with Python: What's the difference between using running it through mod_python vs. building an application server using Python-based tools like CherryPy, Quixote, Draco, etc.? Thanks.
2
7634
by: Brian Blais | last post by:
Hello, I'd like to start trying out some cherrypy apps, but I've been having some setup problems. I think I need some bone-head simple example to clear my understanding. :) I'm on a system running Apache, that I don't have root access to. I will be publishing the html/image/python files in a directory off of my current web page, and running the app as a user on the system. I'd like to be able to specify the base url for the app,...
0
1092
by: Jean-Paul Calderone | last post by:
On Tue, 23 Sep 2008 21:22:08 -0500, Michael Mabin <d3vvnull@gmail.comwrote: You haven't described the problem you want to solve in very much detail. I can't tell, for example, why I shouldn't recommend that you use Apache instead of CherryPy or Twisted or anything else. Apache has a huge user community, lots of documentation, and lots of developers fixing its bugs and making it work well. What are you trying to do that would make...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.