converting %20 to spaces

John Roth newsgroups at jhrothjr.com
Sun Mar 14 15:06:16 EST 2004


<ketulp_baroda at yahoo.com> wrote in message
news:f046efac.0403141156.3135c1d9 at posting.google.com...
> Hi
> I am storing the attachments in files on the server.User can see all
> the attachments & view any of them.
> My application shows the attachment correctly for file which have no
> spaces in their name.
> But it doesnt works for file names with spaces.As the spaces are
> converted to %20.It gives an error:No such file or directory.
> How do I avoid converting of spaces to %20??
> Also one more problem creeped up.
> I am using <input type=file> method for uploading attachmnets..Then I
> create a file on the server & copy the contents to that file.When I
> display the attachments the text files & html files are displayed
> correctly but the image files are distorted.
> Do I need to escape sequences or do something else?
> Please help

Look at the quote() and unquote() functions in the urllib module.

John Roth





More information about the Python-list mailing list