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

chr at home.se chr at home.se
Wed Mar 2 11:00:53 CST 2005


On Wed, 2 Mar 2005, Patrick R. Michaud wrote:

> This option already exists (and always has) -- see
> 
>     http://www.pmwiki.org/wiki/Cookbook-V1/UploadGroups
>     http://www.pmwiki.org/wiki/Cookbook/UploadGroups

I know, but I had to start my question somewhere :-)

> > > Essentially, I'm thinking the Attach: markup will become:
> > > 
  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]]

> > Or do you mean that the above would be enabled by standard?
> 
> I'm thinking that the above would be standard.

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. 

While looking at wiki.lyx.org, I started thinking about what will happen
if people start moving pages around. Typically someone might decide that
this set of pages should actually be of a group of its own. I guess you
could still keep the files in the original group, seems untidy though.

For that reason I changed some of the Attach:-links on wiki.lyx.org to use
absolute paths, i.e. I made them into e.g. Attach:/LyX/Dir/SubDir/file.txt
(this uses the syntax from ExtendedUpload of course)

Perhaps we should have two separate directives/prefixes. One that is
"local" (Attach:) and one that is site-wide (uploads:), 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

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. 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.

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/).

I can accept not having periods in page names, but I do want to be able to
have them when structuring files pertaining to different releases. But if
I can use uploads: for directories with these names that won't be a
problem.

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.

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).

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. (Or perhaps we 
could use File:)

> > Anyway, regarding wiki.lyx.org, there are quite a few files uploaded and
> > referred to using the extended syntax I used before. [...]
> > in short I have to get this working before I can do the upgrade.

Having written the above, it would probably be feasible for me to replace
references to attached files with e.g. uploads: using absolute paths. I
could then use this together with the standard version for Attach:  (once
I've written the code for uploads:).  This would proably work well for me 
since I won't actually have to change the location of any of the attached 
files.
 
> Yes, that's likely.  Fortunately you're not likely to have another 
> upgrade like this for a very long time.  :-)

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.

That way we'd also get practical results if the attach-by-page works in 
practice, and how much the lack of periods really is (the latter will 
probably be a problem).

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

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list