Support » Plugins » Attaching file to a post

  • version 2.7

    Hi, when i write a post i want to attach a file to it, say perhaps a .doc or pdf/jpeg but i dont want it to appear in the post but rather as an obvious link with a download icon next to it after the post, cant seem to find a plugin for this…any idea.

    I want the upload of the PDF (or whatever) to be straightforward, ie browse for file attachment..upload..and its attached to the post.

    ta in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • hello, any takers?

    I don’t think ECHOOooo understood oldbag66’s question. The answer seems to be that WordPress has no facility for attaching files to posts unless the files in question are media files embedded in the post. Note the statement in the codex link BEGIN QUOTE They do not become “attachments” until you actually Insert them into the post. Therefore, it is a misnomer to call them attachments; it may be more accurate to call them “embedded files.” END QUOTE

    One can upload any file to the wp-content/uploads directory, using either the wp-admin interface or an ftp client, and then provide a link to this file in the post, but WordPress 2.7.1 doesn’t provide any way (that I have found) to mark the file as “attached to” the post. You’ve got to know the URL to the file and code it into the post.

    If you use an ftp client to upload, WordPress doesn’t know that the file is in the “Media” library–it won’t show in the list. This is no problem as long as you use the ftp client to show what files and directories are in wp-content/uploads/.

    Note also that uploading files using the wp-admin interface forces file names to all lower-case, so you need to write URLs accordingly in your links.

    Correction: when you create a post and save it, then use the upload feature in the editor, the uploaded files become “children” of the post.
    They will not be displayed without either embedding the links manually in the editor, or using a theme function to list all attached files, but they are “attached” as long as the post “exists” (is saved and has a permalink) and the uploads were uploaded using the upload button in the editor.

    That’s how I set up my sites for my clients – “create post, save, then upload stuff, then publish”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Attaching file to a post’ is closed to new replies.