PmWiki »

Uploads

PmWiki.Uploads History

Hide minor edits - Show changes to output

May 14, 2017 by Lakesha - tfbMawMdCj
Changed line 1 from:
Appreciate the actual auspicious writeup. The idea in fact had been a new enerateinmtnt bank account this. Seem sophisticated for you to more sent reasonable by you! In addition, how can we be in contact?
to:
We've <a href="http://lwqfuuyotm.com">arrevid</a> at the end of the line and I have what I need!
May 14, 2017 by Aira - Qj9PvyMVyPk
Changed lines 1-104 from:
(:Summary:Allow authors to upload files, also known as page attachments:)
(:Audience: authors (intermediate) :)
[[PmWiki]] can be configured to allow authors to upload and store files and [[images]] (known as attaching them).
These attachments may then be referenced from any page. 

-> ''Note'': ''[[PmWiki]] is distributed with uploads disabled by default.  See [[Uploads Admin]] for information about how to enable and configure the upload feature.''

-> ''Note2'': ''Uploads can be configured site-wide, by-group, or by-page; see [[Uploads Admin]] for details. This determines whether all uploads go in one directory for the site, an individual directory for each group, or an individual directory for each page. The default is to organize uploads by [[WikiGroup | group]].''

!! [@Attach:@] Syntax
To add or link to an attachment, an author edits a page to include the markup "@@Attach:@@" followed by a name of an attachment (e.g., "@@[=Attach:resume.pdf=]@@").  When the page is displayed, the @@Attach:@@ markup becomes one of the following:

* A link to the named attachment (if uploaded, ie already in the upload directory)
* A link to a form whereby the author can specify a file to be uploaded and used as the new attachment (if not yet uploaded, ie not in the upload directory)
* If the attachment is an [[image(s)]] file with an extension such as .gif, .jpeg, or .png, it is displayed as an [[image(s)]].

The behaviour of links can be modified to
* prevent an image attachment from displaying as an image, place it in double brackets (e.g., [@[[Attach:image.jpg]]@]).
* have a link to an attachment appear without the "[@Attach:@]" at the beginning of the link, use [@[[(Attach:)file.ext]]@].

!! Attachments on other pages and groups
To link  to an uploaded attachment (image or file) from another group, you simply refer the group itself (make sure "Groupname" has the dot in it).
->[@Attach:Groupname./file_name.ext@] (note the dot after the groupname)
If PmWiki is configured with an individual directory per page use
->[@Attach:Pagename/file_name.ext@] (Pagename is in the same WikiGroup)
->[@Attach:Groupname.Pagename/file_name.ext@]

!! Names with spaces
To link to a filename with spaces in it use the bracket link notation, eg
->[@[[Attach:a filename with spaces.txt]]@]

"Embedding in the page" an image with spaces is not supported: just upload the images with names without spaces, and use the markup [@Attach:image.jpg@].

The following workaround is possible, but is unsupported and not recommended:
->[@[[#blank | Attach:image space.jpeg]]@]

!! International characters in file names
See [[UploadsAdmin]] and $UploadNameChars.

!! Listing Uploaded Files On A Page
To list files that have been uploaded, use the markup:
[[PmWiki/PageDirectives#attachlist | [@(:attachlist:)@] ]]

This will list attachments to the current group or page, depending whether attachments are organised per group or per page; each instance includes a link to the attachment for viewing or downloading.  A list of attachments is also shown as part of the uploads page form.

!!!Upload Form / Upload Replacement
One can go directly to the upload form by appending "?action=upload" to the URI for any page that has file uploads enabled by the [[Wiki Administrator]]. Replace a file by simply uploading a new version of the file with the same name.
* Be sure to clear your browser cache after replacing an upload. Otherwise, it may appear that the original upload is still on the server.
If you put @@$EnableUploadVersions=1;@@ in your @@local/config.php@@, the old versions of the same files are renamed and not removed.


!!!Type and Size Restrictions
For security reasons, the upload feature is disabled when PmWiki is first installed.
When enabled uploads are restricted as to the types and sizes of files that may be uploaded to the server (see [[UploadsAdmin]]).  PmWiki's default configuration limits file sizes to 50 kilobytes and file extensions to common types such as ".gif", ".jpeg", ".doc", ".txt", and ".pdf". 

In addition, the administrator can configure the system to require an @@upload@@ password--see [[Passwords]] and [[PasswordsAdmin]].

By default the upload allows the following extensions. Note that by default, no file extension is required.

[[#imagetypes]] 
->[@'gif','jpg','jpeg','png','bmp','ico','wbmp','svg','xcf'        # images
@]
[[#imagetypesend]]
->[@'mp3','au','wav','ogg','flac',                                # audio
'ogv','mp4','webm','mpg','mpeg','wmf','mov','qt','avi',        # video
'zip','7z','gz','tgz','rpm','hqx','sit',                      # archives
'doc','ppt','xls','mdb',                                      # MSOffice
'exe',                                                        # executables
'pdf','psd', 'ps','ai','eps',                                  # Adobe
'htm','html','css','fla','swf',                                # web stuff
'txt','rtf','tex','dvi',                                      # text files
'odt','ods','odp','odg',                                      # OpenOffice.org
'epub','kml','kmz',''                                          # misc@]

!!!Removal
At present uploaded files can only be deleted from the server by the [[wiki administrator]]. Any uploads-authorized user may over-write an existing file by uploading another of the same name and extension to the same location.

The administrator may remove an uploaded file by accessing the server via ftp (or via a control panel, if the host offers such a feature). The recipe Cookbook:Attachtable allows the deletion of the files from the wiki.

>>faq<< [[#faq]]

Q: When I upload a file, how do I make the link look like "file.doc" instead of "Attach:file.doc"?
A: Use parentheses, as in [@[[(Attach:)file.doc]]@].  There is also a configuration change that can eliminate the [@Attach:@] -- see [[Cookbook:AttachLinks]].

Q: Why can't I upload files of size more than 50kB to my newly installed PmWiki?
A: Out of the box PmWiki limits the size of files to be uploaded to 50kB. Add
->@@$UploadMaxSize = 1000000; # limit upload file size to 1 megabyte@@
->to your ''config.php'' to increase limit to 1MB (for example). See [[UploadsAdmin]] for how to further customize limits.  Note that both PHP and webservers also place their own limits on the size of uploaded files.

Q: Why does my upload exit unexpectedly with "Incomplete file received"?
A: You may be running out of space in a 'scratch' area, used either by PmWiki or by PHP.  On *nix, check that you have sufficient free space in /tmp and /var/tmp.

Q: How do I make it so that the upload link still allows one to make another upload (if someone wants to replace the old version of a file with a newer version, for example). Currently you only get the upload link when there is no file in the upload directory.
A: Use the Attach [[Site/page action(s)]], and click on the delta symbol %blue%(&Delta;)%% shown against each of files listed. If you can't see the attach action either uploads are not enabled, you are not authorized to upload, or the attach action has been commented out or is missing. See also [[PmWiki/available actions]].

Q: How do I hide the "[=Attach:=]" for all attachments
A: See Cookbook:AttachLinks, note that this does not currently work for [@ [[Attach:my file.ext]] @].

Q: How can I link a file that have a 4-letter file extension such like 'abc.pptx'?
A: See [[Cookbook:Upload Types]]

Q: How can I prevent others from using the url's of my images on their site
A: See [[Cookbook:Prevent Hotlinking]] {Cookbook.PreventHotlinking$:Summary}

to:
Appreciate the actual auspicious writeup. The idea in fact had been a new enerateinmtnt bank account this. Seem sophisticated for you to more sent reasonable by you! In addition, how can we be in contact?
Page last modified on May 14, 2017

Edit - History - Print - Recent Changes (All) - Search