Exposing wordpress media files to visitors - wordpress

I need to add a page on my wordpress site showing documents uploaded through the media library (ideally only specific files such as pdf, docx etc not images files). The idea is to have visitors directly download such files without logging in.
Any ideas on how to go about it ?
Thanks,
Mark

This is something that will be best implemented through a Wordpress plugin. Take a look at http://wordpress.org/extend/plugins/media-library-assistant/
At the end of the day, if you can't find a pre-existing plugin, your best option is to make one. Some links for plugin development are:
http://codex.wordpress.org/Writing_a_Plugin
http://codex.wordpress.org/Plugin_API
http://codex.wordpress.org/Plugin_Resources

Related

Access Sharepoint files in WordPress media library

Is there a known way of connecting WordPress and Sharepoint in a way, that i can choose files located in Sharepoint inside my WordPress media library?
I searched for hours, but cannot find a solution.
Probably looking the wrong direction.
I read the Sharepoint API -Documentation on files, and learned that I could probably write a Plugin myself, but this will probably get pretty time consuming.
I also found a tutorial on how to automatically create posts in WP from Sharepoint using Powerautomate. I could probably adjust this in order to push files from Sharepoint to WordPress. But I actually don't wont to copy files to WordPress, I want to access them directly.
As a further approach i integrated OneDrive into WordPress using this plugin
But this just creates a new problem because I can't find a way to access the folder, created by the Plugin in OneDrive from Sharepoint.
It boggles my mind, that I can't find a ready made solution.
I can't be the only one with that requirement, or am I?
Help is greatly appreciated

Is it possible to develop a wordpress plugin that can upload and display a HTML5 app?

I have a desktop app that generates small HTML apps (a zipped folder with a single HTML page, a bunch of scripts with WebGL stuff and a bunch of media files).
Now I would like to make this HTML app easy to deploy to wordpress through a plugin that would:
Let the user upload the zip file from his hard drive
Unzip the contents and store them somewhere
Create a page that displays the HTML app
I'm not looking for actual code yet, just to know that this is possible and that it doesn't violate some constraint. Of course, pointers to information on how to achieve this are welcome.
Thanks for any help
It's hard to give pointers since it's a really broad question, but as for your plugin requirements: all is possible via php and thus, all is possible in a WP plugin.

Uploading unpermmited filetypes for virtual products on woocommerce

I would like to sell an eBook on my website. I'm using WordPress and the shop uses woo commerce, which I just switched over to.
The problem is, the eBook comes in a folder, which is not so simple to upload and sell. If I upload an .exe file, I get the message "Sorry, this file type is not permitted for security reasons" and there are certain files in the eBook folder which generate the same error.
I can use WinRAR or similar to compress it and then upload it that way, but I can't assume my users will have the technical ability to know what to do with it once downloaded.
The alternatives I came up with:
I have an install (.exe) file which is easy to download and use - it simply extracts everything and leaves shortcuts.
Ideally I would like to upload the entire folder and have the user be able to download the whole thing at once but, even if I could upload it, it doesn't seem possible to select an entire folder but only individual files - I would be really grateful if someone knew of a way to do this!
I'm yet to find a workable solution so any help would be much appreciated.
Edit: Should have added this is for interactive eBooks, not a simple pdf, unfortunately.
You are hitting WordPress' internal restrictions on file / mime types for adding anything to their Media Library.
This plugin should allow you to add .exe as a valid mime type.
https://wordpress.org/plugins/enhanced-media-library/
More details from the WordPress forum:
The underlying WordPress function called get_allowed_mime_types is used which is filterable and can be customized based on your needs via the WordPress provided filter named upload_mimes which is documented here: https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
Thanks, WilltheWebMechanic. Your post helped me fix the issue without reverting to an older version of Woocommerce.
If anyone else is wary of the functions.php file like I am, you can use a plugin for it.
This is the one I used, and it seems nice and stable. Plus, it’s compatible with Woocommerce, which is why I chose it: https://wordpress.org/plugins/enhanced-media-library/
Once it’s installed, you can just add your file type to the ‘Mime’ section of the plugin.
I just added the file types I needed (epub and mobi). I hit save and my products are all working again.

Integrating Wordpress from one WP site into another non WP site

I am developing a mobile version of a current WP site, but this mobile version is not WP. So I need to be able to access the information in the database of the non-responsive, existing WP site in this new one. The mobile site is located in a sub-folder called mobile (somesite.com/mobile) in the root directory of the current WP site.
I've visited the WP forum and posted this same question without responses. I've also read their integration page (http://codex.wordpress.org/Integrating_WordPress_with_Your_Website) but it doesn't seem like that would work for this application, because I figure it would just cause the mobile index.php page in the /mobile folder to just revert to the main theme.
Any suggestions or advice would be much appreciated.
You should use the integration guide you posted:
define('WP_USE_THEMES', false);
This part tells wordpress not to use themes.
I think a better approach to this problem is to make the current wordpress theme responsive:
there are a number of ways to achieve this: you can add separate stylesheets for different browser sizes: http://css-tricks.com/resolution-specific-stylesheets/ or you can use css3 media queries directly in the stylesheet: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
You must create the new site using data from the WP site.
Ok. You will need to create your html/php files, but, using WP database.
You can just access WP database and query it... but you will have a lot of work, in some places... like, URL, you will need to transcript URLs saved on database, and, when a user click on that link, you will need treat it to find "back" what URL it means, to catch the content.
I't not a easy job.
The WP_Query (http://codex.wordpress.org/Class_Reference/WP_Query) class can easy your life.
The WP_Db (http://codex.wordpress.org/Class_Reference/wpdb) too.
Both, I think you can use without the whole WP.
But, like #Jonathan said, build a responsive template will be a best solution.

wordpress, a download manager for outside URLs

I'm working on a online file library for one of my clients. It's a library for mostly PDFs and office documents. Because they are a huge amount(almost 2gb in files), I'm hosting them on another site(divshare), so that the hosting account we have doesn't get blocked by the excess of files, and also because of excess traffic downloading can generate.
So, my question is if there is a good download manager(even with some search for download categories and so) that can handle instead of local uploaded files, URLs of files hosted somewhere else?
The advice about any plugin or the like is very appreciated.
You ask how to code such manager, right? Otherwise, your are on the wrong site...
I think you need to make a kind of file manager, except that instead of generating HTML pages to view the files and act on them, it exposes a Web API, returning XML or Json data, that a WordPress plugin can manage.
From Divshare:
The DivShare Uploader Plugin for Wordpress replaces your regular
uploading frame with a DivShare upload form, allowing you to easily
upload and add files without ever leaving your "Write a Post" page.
It's a great way to speed up your blogging and take the load off your
servers when hosting big files and images.
It can be found here: http://www.divshare.com/integrate
Good Luck!
Marcelous

Resources