I have a front-end file uploader which (logically) allows my users to upload files from the website itself. (It restricts them to only upload pictures or certain text files). They can upload files from calendar items and wordpress automaticly adds that page title to the file.
So if i have a calendar item called : Meeting of the 21th of September 2012, and i upload, lets say, an image to that item. That file would be put in the backend of wordpress with the file location of: Meeting_of the_21th_of_September_2012. Now i want users to be able to watch these files from the location that they uploaded it from. (there are multiple users that can access the calendar, if person 1 uploads a file i want all the other people to see those files (in the front-end)).
Is it possible to show all media associated with a certain page with my certain setup? Is this at all possible?
Screenshot below is of an uploaded media file (its in dutch but the text 'Geupload naar:' means 'uploaded to:' (which is the name of the calendar page).
Yes, you can display all media files.
You can do that by creating a folder by 'page name' or by 'id' and access all files from that folder.
or
You can store file id with page id in a database custom table or meta table and access the files from there.
Related
I've just started learning the WordPress CMS, i have a small PHP programming background and i wanted to masters in WordPress now. for the learning sake, i have started a project on my local server, Where user can register, login and upload images afterwards.
My Question is that, how do i organize all media uploads to a Category Base directory, all uploads should go to a specific directory based on user selection. If user selects "PLACES" category then the uploaded image/file should go to Places directory.
-Thanks
UPDATE
If the above option can not be achieved then how about creating a directory with post slug? like year/month/day/post-slug/images goes here
Only your written articles can be sorted by category.
Unfortunately there is no folder system for images. The only thing you can do is writing a post, import a image into the article and assign a category to the article. But anyway, assigning a category to a image is not necessary.
TL;DR: Can I upload hundreds of files via WordPress (vanilla or with free/premium plugins) which will appear on my website as downloadable files, or would another CMS be better suited to this task?
More info: I'm building a site to replace an old WordPress MU site. My (non-technical) client needs to be able to create a single profile page for each of their employees. Each employee page must include some or all of:
A header image
A text intro
A photo gallery
A list of links
Multiple audio embeds
Multiple video embeds
A list of ~1000 downloadable files, mostly pdf/jpg, divided into subgroups
Ideally the last point would be achieved something like this:
Client adds a custom field and must name it
Client drags any number (realistically 1-100) of files onto the field, or uploads via "add files" function
Files are saved in the backend to a folder named after the custom field
File order is editable by client
The field is output to the HTML page like this:
<h1>Custom Field Name</h1>
<ul>
<li><a>file1.pdf</a></li>
<li><a>file2.jpg</a></li>
...~100
</ul>
Employee A is totally separate from Employee B, C, etc. All employees' pages will be managed by a single user. Their files should exist separately in the backend. The paths to their files will ideally include their name, but only the filename itself needs to be printed to the page. A file system like this would be perfect:
/EmployeeFirstName-EmployeeLastName/Media/YYYY/Filename.xxx
I believe WP's default media file save directories can be customised via plugins.
I'm trying to do this in WP because it's what I've used in the past and it's what my client is familiar with. A friend recommended the Advanced Custom Fields plugin for WP, which I am looking into. I'm an experienced designer but a beginner developer. I accept my naïveté and I'm keen to learn.
Possible structures:
A single WP install with a Page per employee
A Multisite WP install with a Site per employee
Other?
After much searching I'm beginning to think WP might not be a suitable platform for long and busy pages (~80 video embeds per page, added via ACF) with this type of file management requirement. The admin page for my test page is already very slow to update and I haven't even started the file list part.
Since the key feature of this page template will be the ability to list hundreds of downloadable files, it seems logical to me to pick a CMS based on that requirement, rather than pick a familiar CMS and try to force it to do what I want.
Thanks for reading!
I have used
Download Attachments plugin which provide facilities to upload attachment as post meta from admin panel and user can download it from front end. Try it might help you.
Like what we do in sending email in yahoo, Now in my aspx I want to make a page it's name is "draft" and in this page there is one subject field (txtsubject") and upload control with upload button for attaching multiple files and one another button for save/send in database table, now I do not know how it should be my design table.
I read some article from net about how to upload multiple files and in all of them there is one table like below design
Fileid
File name
Content type
I am building a WordPress website that will allow members to upload media such as videos, images, etc. They will do this on a public form at for example: domain.com/upload
The form will ask for a Title, a brief summary, show some categories to choose from, and finally a file uploader. The user will then be able to submit the form and it will appear on the site as a post but instead of being just text it is a piece of media.
I have created a custom post type and all seems to be fine, the problem I have is how to deal with the media upload, as the default WP method is to upload an item and then manually insert it into the post (and you can have as many inserted as you like). Where as I want users to be only able to upload one file per post and not have to insert the file into a post because the file itself is the post. They will also be able to upload a featured image.
Any ideas on how I can develop this? Thanks.
You could use WP upload methods to upload your file to the server. Then (depending on your upload's media type) you would insert HTML representation of the file into the post (e.g. parse a text file, create tag for image or embed a video).
If you want to see some working example, please let me know. I just outline the flow:
wp-handle_upload() to physically upload a file
wp_update_post() or wp_insert_post() depending on whether you're creating a new user post or editing existing one. Both methods require one argument - Post object. That's where you put your content (as a post_content field of course) and post data
I'm looking to find a WordPress plugin that ads an upload widget to my post editor to allow me to associate images with posts.
The end result is that I can add a bit of code to my theme's single.php file that allows me to load all of the images that reside in the folder matching the post id.
If no such plugin exists, I'm looking for some help on creating one.
Here's the way it would work..
Any images uploaded to a specific post, will go into a folder named after the post id. For example, if you are editing the post with id=420, the uploaded files will go into a folder named "420". There would also need to be some way to add or remove images from the folder without leaving the post editor (though FTP could be used for this as well).
To show post specific images, the single.php file checks to see if there is a folder under wp-content/uploads matching the post id. If it finds a match, it simply loads all the images it finds in the folder.
You can already attach images to a post without including them in the main content. You can do all of this in the main Edit Post window (the first icon next to "Upload/Insert" above the text editor. They are added with the post id as parent_id parameter, so the get_children function will give you all attached files.
This will store the images in the standard /wp-content/uploads/ folder, grouped by year and month (if you checked that option in the administration page). If you want to change the upload directory, you can use the upload_dir filter (slightly outdated parameter list) and return a different upload directory, for example with the post ID. The upload_dir filter is called from wp_upload_dir(), which is called by wp_handle_upload(), which is called by media_handle_upload(), which is called from the media-upload.php file.
If you want to extend this idea and check the upload dir for new files (uploaded via FTP for example), and attach these to the post, I suggest you look into the attachment functions.