[Zope] Re: Problem uploading file through a form with Internet Explorer

Max M maxm at mxm.dk
Tue May 4 05:08:05 EDT 2004


Swito wrote:

> It works perfectly as long as I use Mozilla (both under Linux and
> Windows) or Opera (tested only under Windows), but as soon as I try to
> use Internet Explorer Zope returns an error message saying that there
> are characters not allowed in URLs. Uploading photos from the management
> interface works perfectly.
> 
> I would be greatful if anyone could suggest a solution for this problem
> or explain it to me. It's a big mistery to me.

It's easy.

The client/webbrowser sets the filename.

Mozilla, among others, removes the path part of the filename.

IE sets it to the full path.


Given a file at this location:

     c:/image/logo.jpg

IE:

     c:/image/logo.jpg

Mozilla:

     logo.jpg


So to make shure that you only get the filename part of the path, you 
need to parse the path, and remove the extra fluff.

Or use the addPhoto() method in the Photo product. Which seems to do the 
right thing. Eg call "id, title = OFS.Image.cookId(id, title, file)"


regards Max M




More information about the Zope mailing list