[pmwiki-users] Upload gif, pdf etc

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 6 10:48:21 CST 2006


On Mon, Nov 06, 2006 at 02:02:05PM +0200, Mark Trumpold wrote:
> I would like to upload a gif or jpeg from the edit page as a form. So the
> student can browse for the file and the link automatically put in. 

Having "link automatically put in" from the edit form is a bit
difficult, for several reasons.  First, many browsers (Opera, Safari) 
don't allow scripts to easily insert text into the edit window
at the current cursor location.  In such browsers the Attach:
link would end up always going to the bottom of the text, which
would be annoying/surprising for many authors.

There's also the problem with having two separate forms in
the edit page itself.  Suppose someone writes some text in the
editor window, and (without pressing "Save") uses the upload
form to upload an attachment.  Because of the way browsers and
HTTP works, their edits will be lost.  So, the upload form
needs to be in a separate tab or window in order to prevent
edits from being lost.

Either that or we handle upload requests as also acting
like a "Preview" operation, in that the text is sent back
to the server with any changes.  That could be possible.
Too bad there's not a way for the browser to tell us where
the cursor was located when the upload took place, because
then we could insert the attachment at that point fairly
easily.

Oh well.

> Also, is it possible to have more than one upload directory, one for images
> and one for other types?

It's possible but not simple, because then the Attach:
markup isn't sure where to look for things.  We'd need
two separate markups for that.

Pm




More information about the pmwiki-users mailing list