On 7/20/06, OriginalBrownster <[EMAIL PROTECTED]> wrote:
>
> Hi there, I'm using a kid template to upload a file to a specific
> directory
>
> This unfunction is working but i'm currently using
> .open.file.read(8192)
> to read the data then copy to the directory. This does not work for
> word docs and pictures and other file types.
>
> So i have decided to use the shutil.copy function to copy the files.
> Heres the problem though in my kid template I have
>
> <form action="upload" method="post" enctype="multipart/form-data">
> <input type="hidden" name="pagename" value="${page.pagename}"/>
> Filename: <input type="file" name="upload_file" text="hello"
> onChange="passpath()"/>
> <br/>
> <input type="submit" value="Upload"/>
> </form>
>
> dont mind the formatting
> know to use the shutil.copy function I need the pathname and the
> destination. I will have the destination of the file however getting
> the pathname from the input type= file
> has become a challenge.
>
> Any ideas to a work around?
>
> The user will be selecting the file using the browse function. Anyway
> of grabbing that path and using it?? it may be simple but its alluding
> me.
>The CherryPy[0] site has lots of info on how to do file uploads. David Stanek [0] http://www.cherrypy.org/wiki/FileUpload -- http://www.traceback.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

