[pmwiki-users] "Name attachment as:"
Patrick R. Michaud
pmichaud at pobox.com
Fri Sep 8 08:33:10 CDT 2006
On Fri, Sep 08, 2006 at 03:27:12AM -0500, JB wrote:
> This is confusing me. You are suppose to predetermine
> the filename that you will upload in a page source link
> and then click the link, and then browse to the file
> to be uploaded and then it will upload the file and then
> rename it to the filename specified by the link unless
> you change it in the "Name attachment as:" input box. Whew!
Actually, this is what makes sense for many cases. It's not
always the case that the way a file is named on a local drive
is the way it should be named in a page attachment.
> When the "Name attachment as:" input field is blank
> pmwiki keeps the same filename that was uploaded.
> I know 2 ways to not have any text in the
> "Name attachment as:" input field on the upload page
>
> [[{$Name}?action=upload|Upload]]
This is the only one I'm aware of.
> [[action:upload|Upload]]
This works if there's a special "action:" InterMap entry defined.
> I prefer to just upload the file and use the filename
> that the user is uploading. I do not see any kind of
> option for that using the "attach:" syntax.
Right, because "attach:" needs to have a name after it in
order to be meaningful. Just writing "attach:" by itself
doesn't mean anything -- PmWiki has no way of knowing what to
"attach".
> I would like to be able to specify that the
> "Name attachment as:" input box not be displayed
> and always use the uploaded filename and not the
> link. Is this possible?
It's possible to eliminate the "Name attachment as:" box, yes:
$PageUploadFmt = array("
<div id='wikiupload'>
<h2 class='wikiaction'>$[Attachments for] {\$FullName}</h2>
<h3>\$UploadResult</h3>
<form enctype='multipart/form-data' action='{\$PageUrl}' method='post'>
<input type='hidden' name='n' value='{\$FullName}' />
<input type='hidden' name='action' value='postupload' />
<table border='0'>
<tr><td align='right'>$[File to upload:]</td><td><input
name='uploadfile' type='file' /></td></tr></table></form></div>",
'wiki:$[{$SiteGroup}/UploadQuickReference]');
At some point I may end up making this into a wiki page
(i.e., Site.UploadForm), but I haven't gotten around to doing
that yet.
Pm
More information about the pmwiki-users
mailing list