[pmwiki-users] File attachments and upoads (was Re: Re: Extended uploads for v2)

Patrick R. Michaud pmichaud at pobox.com
Wed Mar 2 12:20:38 CST 2005


On Wed, Mar 02, 2005 at 06:00:53PM +0100, chr at home.se wrote:
>   Attach:file.txt                - file.txt attachment for the current page
>   Attach:Other/file.txt          - file.txt as attached to [[Other]]
>   Attach:Group/Other/file.txt    - file.txt as attached to [[Group/Other]]
>   Attach:Group.Other/file.txt    - file.txt as attached to [[Group.Other]]
> 
> Ok. I'm still ambivalent about this... and slightly worried that it'll 
> have some bad implications that we don't think about right now. 

Okay, let's work through them a bit.

> Perhaps we should have two separate directives/prefixes. One that is
> "local" (Attach:) and one that is site-wide (uploads:) ...

The possibility of an "uploads:" prefix is explicitly mentioned on the
Cookbook.UploadGroups page.  :-)  It's easy to add into the intermap.

> ... where in your current suggestion this would be the equivalences:
>   Attach:file.txt             == uploads:{$Group}/{$Name}/file.txt
>   Attach:Other/file.txt       == uploads:{$Group}/Other/file.txt
>   Attach:Group/Other/file.txt	== uploads:Group/Other/file.txt
>   Attach:Group.Other/file.txt == uploads:Group/Other/file.txt

Uh, no, or at least not by default.  I haven't said anything
about creating nested group+page subdirectories -- by default
the attachments are still organized "per-group" with the admin
having the option of changing this structure.  What 
Attach:Other/file.txt refers to is the same as "Attach:file.txt"
on the [[Other]] page.  So, assuming 
   - attachments are organized per-group
   - there's no page called Other.Other or Other.HomePage
we get
    Attach:file.txt             == uploads:{$Group}/file.txt
    Attach:Other/file.txt       == uploads:{$Group}/file.txt
    Attach:Group/Other/file.txt == uploads:Group/file.txt
    Attach:Group.Other/file.txt == uploads:Group/file.txt

> The advantage as I see it with uploads: is that you can normally just take
> the URI of an attached file (or as you intend it to be) and replace the
> beginning with "uploads:". That should be easy for users to understand. 

Somehow I have trouble with the combination of "the uri of an attached
file as you intend it to be" and "easy for users to understand".
Most users don't have any idea or intention of uri structure, especially
when it's hidden behind an attach/upload interface.

> In addition, this would allow me to extend the syntax to allow arbitrary
> paths after uploads:, i.e. not necessarily the name of a existing group 
> and/or page.

The uploads: intermap syntax certainly allows this.

> Looking at the last example, I'm not happy about the '.' to separate
> Group.Other... At wiki.lyx.org it's useful to be able to create
> directories with periods in the name (e.g. lyx-1.3.2/ and lyx-1.3.3/).

As currrently formulated wikigroups cannot have periods.  It's not
a restriction of the attachments interface, it's a restriction on
page names.  (Put another way -- what follows "Attach:" isn't a url
path.)

> As for the Attach:-syntax above, I wonder if it wouldn't be better to keep
> that specific directive simple and have it *only* refer to files attached
> to the current page. Referring to pages attached to a different page would
> then have to use uploads: instead.

No, because this somehow assumes that the author knows the underlying
structure of the uploads: directory.  It's better to have a mechanism
where I can say "I want attachment file.xyz from page ABC, wherever it
happens to be located".

> Btw, what should happen if I use
> 	Attach:OtherPageThatDoNotExist/file.txt
> to upload a file?  (This is one of the reasons I've got a bit of a mess 
> among my uploaded files, people make a small spelling error and the file 
> ends up in the wrong place).

Well, if you're organizing your attachments per-group, then it'll go
into the current group.  If you're organizating attachments per-page,
it'll go where that page would go when it gets created.

> Here's another thought regarding the choice between attaching files to a
> page or a group. What if we had AttachToPage: and AttachToGroup:  for the
> two respective alternatives? The names are a bit long, but you get the
> idea -- Attach: could for instance continue to attach to the current 
> group, and PageAttach: could attach to the current page. 

Seems like overkill.

> What is the status of this code right now? It seems silly for me to try 
> and create an UploadExtended if this is almost ready. In that case it'd 
> probably be better if I tried using that on a beta-version of wiki.lyx.org 
> first.

It's still mostly in my head -- I know exactly how to implement it but
just haven't had a chance to do so.  Plus your messages are the first
extended discussion on the topic, and as you said at the beginning
of your message there may be some bad implications for this.  One
problem with immediately releasing the feature in code is that if
people start using it then it's hard to get rid of if we decide it's
bad.  :-|

> (I'm accepting that I'll probably have to redo this a few times before I 
> actually do the real transition).

Oh.  That's good then.  :-)

Pm



More information about the pmwiki-users mailing list