[tbnl-devel] file upload from windows, pathname?

Edi Weitz edi at agharta.de
Mon Jun 27 21:25:09 UTC 2005


Hi!

On Mon, 27 Jun 2005 14:04:10 -0700, Keith Irwin <keith.irwin at gmail.com> wrote:

> When I upload a file, I get a structure something like:
>
>  ("file" #P"/tmp/tbnl/tbnl-10" "Water Lillies.jpg" "image/jpeg")

Hey!  I used the same test file... :)

> which is just fine.  Documented, after all.  And this works using
> firefox on both linux and windows.
>
> BUT, when I use IE on windows (where else), I get:
>
> ("file" #P"/tmp/tbnl/tbnl-10" "C:\\\\Documents and Settings\\\\All
> Users\\\\Documents\\\\Sample Pictures\\\Water lilies.jpg"
> "image/pjpeg")
>
> As you can imagine, this causes a slight bit of weirdness when I try
> to move the file from /tmp to my asset store.  Amazingly, the
> pictures is copied.  The name is a bit long.  But in IE, at least, I
> can't "view" the picture as it translates to images/C:/Documents....
>
> FWIW: images are served by apache, not TBNL.
>
> Easily fixable?

There's nothing to fix, actually. The docs say

  "file-name (a string) is the file name sent by the browser"

and that's what you see.  "Fixing" this would mean to remove
information.

> Or should I just try for a regex to remove everything up to the last
> \ or /?

That's what I do.

Cheers,
Edi.



More information about the Tbnl-devel mailing list