• [ Moderator note: moved to Fixing WordPress. ]

    I am helping a client build a website (we are both experienced, but still amateurs and not professional developers), and he would like to incorporate the ability for his users to upload resume/cover letter templates, and for others to be able to download them.

    Uploading:

    I have explored a variety of plug-ins, and am not quite sure what the best approach is. What we have done so far is signed up for FileStack (not a plugin, but an external API) and have placed the upload button onto the page, with uploads going to an S3 (Amazon) bucket. What we cannot figure out is how to attach the ability for users to fill out a form of information to attach to the upload (description of file, add some tags for searching, etc.).

    1. What’s the best approach to do what we would like to do (plugins, etc.)?
    2. How can incorporate a form of information that attaches itself to the file (completed by the uploader), that will appear to other users?
    3.. We would also like for their files to appear under their user profiles so that they can delete their uploads (as per our privacy policy).
    4. We would prefer that the form for the file description that we would like to accompany the files appear as a pop-up, rather than as a separate page (although, not necessary).

    Downloading

    1. We want the uploaded files to appear for other registered users to be able to download.
    2. Users should be able to search the files by using a variety of criteria.
    3. We would like drop-down boxes to appear at the top of the page to filter the documents available for download (industry type, language, etc.).

    Also, we would like non-registered users to be able to see the available documents and their descriptions, but only registered users are able to upload and download.

    Thank you for your assistance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I suggest you utilize the attachment post type in a manner similar to how local media is handled, the only difference being the media file is on S3 instead of the local server. All related data is stored either in the post object itself or in post meta related to the post. Naturally many of the WP helper functions related media files will not work due to the different location. You’ll need your own versions that interface with the S3 API.

    The attachment posts can be queried like any other media file to collect data that can then be displayed as is appropriate. The only time you need to use the S3 API is to actually do something with the file itself, upload, download, delete. Everything else is done through the attachment post. If your site has local media that use the same MIME type, the S3 files could confuse local queries. In such a case you might be better off with a custom post type that works like attachments do.

    You can add a JS listener to the upload button that opens a pop-up or modal dialog. The entered data can be sent to WP using Ajax methods while the actual file upload is handled by the S3 API. The ability of users to do any particular action can be managed with current_user_can() and is_user_logged_in().

    Thread Starter generalrobot

    (@generalrobot)

    Thank you for your reply! If going this approach, is the only way for a user to submit a file to create a generic post, or can custom fields be created for users to complete upon file submission? I was playing around with the attachments post type, and was not able to see a choice to do this.

    For what would we like, the uploading function would just appear on a page, or a pop-up on a page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘File Uploading and Downloading’ is closed to new replies.