Re: Newbie Question: How to upload an image file and show it?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie Question: How to upload an image file and show it?

Stephan Semerad
The link doesnt go anywhere?

On Friday, August 11, 2006 at 11:13:51 AM UTC+2, Sylvain Hellegouarch wrote:
Hi,

Have a look there:
<a href="http://docs.cherrypy.org/serving-static-content" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdocs.cherrypy.org%2Fserving-static-content\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH1TmsMxU0AzAHxQmm19MC6tQJh7g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdocs.cherrypy.org%2Fserving-static-content\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH1TmsMxU0AzAHxQmm19MC6tQJh7g&#39;;return true;">http://docs.cherrypy.org/serving-static-content

- Sylvain

>


> I want to let the user upload an image file ,then display the image to
> user.
> How can I do it?
>
> I know how to upload file by reading the code in the tutorial09_file.py
> ====================================================
> class FileDemo(object):
>
>     def index(self):
>         return """
>         <html><body>
>             <form action="upload" method="post"
> enctype="multipart/form-data">
>             filename: <input type="file" name="myFile" /><br />
>             <input type="submit" />
>             </form>
>             <a href="download"> downlaod </a>
>         </body></html>
>         """
>     index.exposed = True
>
>     def upload(self, myFile):
>         out = """<html>
>         <body>
>             myFile length: %s<br />
>             myFile filename: %s<br />
>             myFile mime-type: %s <br />
>         </body>
>         </html>"""
>
>         size = 0
>         while True:
>             data = myFile.file.read(8192)
>             if not data:
>                 break
>             size += len(data)
>          return out % (size, myFile.filename, myFile.type)
>     upload.exposed = True
>
> ==============================================
> And what should I do next to show the image ?
>
> Is there any example about this?
>
>
> >

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie Question: How to upload an image file and show it?

Joseph S. Tate

On Tue, Nov 8, 2016 at 8:50 AM Stephan Semerad <[hidden email]> wrote:
The link doesnt go anywhere?

On Friday, August 11, 2006 at 11:13:51 AM UTC+2, Sylvain Hellegouarch wrote:
Hi,

Have a look there:
http://docs.cherrypy.org/serving-static-content

- Sylvain

>


> I want to let the user upload an image file ,then display the image to
> user.
> How can I do it?
>
> I know how to upload file by reading the code in the tutorial09_file.py
> ====================================================
> class FileDemo(object):
>
>     def index(self):
>         return """
>         <html><body>
>             <form action="upload" method="post"
> enctype="multipart/form-data">
>             filename: <input type="file" name="myFile" /><br />
>             <input type="submit" />
>             </form>
>             <a href="download"> downlaod </a>
>         </body></html>
>         """
>     index.exposed = True
>
>     def upload(self, myFile):
>         out = """<html>
>         <body>
>             myFile length: %s<br />
>             myFile filename: %s<br />
>             myFile mime-type: %s <br />
>         </body>
>         </html>"""
>
>         size = 0
>         while True:
>             data = myFile.file.read(8192)
>             if not data:
>                 break
>             size += len(data)
>          return out % (size, myFile.filename, myFile.type)
>     upload.exposed = True
>
> ==============================================
> And what should I do next to show the image ?
>
> Is there any example about this?
>
>
> >

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
Loading...