WordPress.org

Ready to get started?Download WordPress

Forums

Attaching file to a post (5 posts)

  1. oldbag66
    Member
    Posted 5 years ago #

    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.

  2. oldbag66
    Member
    Posted 5 years ago #

    hello, any takers?

  3. ECHOOooo
    Member
    Posted 5 years ago #

  4. gfeeney
    Member
    Posted 5 years ago #

    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.

  5. mores
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic