[pmwiki-users] upload box

Hans design5 at softflow.co.uk
Sun Feb 4 16:31:04 CST 2007


Sunday, February 4, 2007, 10:06:09 PM, Simon wrote:

> is there, or how would you recommend we achieve, the goal of being able to, say,

> (:uploadfile value="add photo to page":)

> in a page,
> see for example http://www.pmwiki.org/wiki/Test/UploadSimpleForm
> and I think that this is close to answering the question
> if we understood what values the name=action hidden field could take,
> and how to connect to processing of the form data.

> in addition after the upload it should return to the original page,
> not to
> http://www.pmwiki.org/wiki/Test/UploadSimpleForm?action=upload&uprname=014_10A.jpg&upresult=success

> Is this now 'out of the box' in PmWiki?

The form on Test.UploadSimpleForm does upload a selected file.
In order not to go to the upload page with the attachment list
afterwards, you need to define your own HandleUpload function, lets
call it HandleCustomUpload, and set
$HandleActions['upload'] = 'HandleCustomUpload';

you could copy HandleUpload from scripts/upload.php, rename it to
HandleCustomUpload, and simply comment the last two lines and adda
Redirect line:

#  SDV($HandleUploadFmt,array(&$PageStartFmt,&$PageUploadFmt,&$PageEndFmt));
#  PrintFmt($pagename,$HandleUploadFmt);
  Redirect($pagename);

which will result in a silent upload, no success or failure reported.


Hans




More information about the pmwiki-users mailing list