Wordpress. Downloadable doc/pdf files by category on my page - wordpress

I have a question. I need to add a downloadable doc/pdf files to my page by category. Tell me what I can do? Doc files will be stored in the database? I can't understand how to realize it. Help, please.

Firstly, you can't store .doc and .pdf files in a database. Your files will be stored in the wp-content folder. Databases are to be used explicitly for storing website content in tables, such as posts, pages and plugin settings for example.
I'd highly recommend you look at some basic WordPress tutorials to understand how WordPress works before taking on something like this.
You can browse the plugin directory to look for a good file manager.
Here's an article that may help you - https://www.wpmayor.com/best-document-file-management-plugins-wordpress/
Google-fu is essential for solving very simply problems like this.

Related

Can a CSV file within a WordPress plugin be accessed from the frontend of a website?

I am currently working on an implementation reading data from a csv file from within a WordPress plugin. It was suggested the file be added within the plugin in an assets directory. I have concerns in doing this. In particular, I'm worried about security and whether this makes the site vulnerable to attacks.
That being said, I looked at the assets folder in the frontend on my local environment and was not able to see the csv file.
Does anyone know if adding a csv file directly to a plugin introduce security risks?
Alternatively, I was thinking about uploading this csv to AWS and reading the data from there.
Good day, Lara.
I am wordpress developer and try to help you now.
We know that every plugin we install should be correct but there are can be some risks.
The wordpress Core do not allow to call CSV and other files directly from folders. For example like assets folder.
But the plugin is third hands software so if a developer do not protect it, anybody can have access to the file.
My advice to check the Stars and Reviews of plugin on
https://wordpress.org/plugins/
Or find reviews of plugin here
https://codecanyon.net/category/all
If it has 4 and more Stars, I think you dont need to worry about security.
Tell please if it helps you...

how to secure woocommerce downloadable files

As the title states I have a question about digital downloadable products through woocommerce. I am new to web development and wordpress so go easy on me. I am trying to add a downloadable product where you can't access the file by direct url. I have set the download type to force download to prevent link sharing but found that I can still access the purchasable files by typing in the direct path Example:
example.com/wp-content/uploads/woocommerce_uploads/2015/06/examplefile.pdf
I have done quite a bit of research but have come up with very few results. One of the only things that I have found is that I should move the downloadable files outside of the root directory. I have attempted to do this but then the download links no longer work. Instead of doing a forced download like normal it redirects to to a page like
example.com/home/user/public_html/home/user/downloads/examplefile.pdf
So I am thinking woocommerce must not be friendly with the files outside the root directory. All in all I am out of ideas of what else to try. Any help or suggestions of how to make this work (having files outside root directory) or other solutions would be greatly appreciated.
If you create a folder outside the public_html directory and upload the files here, you will be safe.
You can find detailed explanations about this topic and how to copy the links of uploaded files in this blog post.
You can add a .htaccess file in the woocommerce_uploads folder with
deny from all

drupal_get_private_key equivalent Wordpress

I'm trying to convert the theme from Drupal to Wordpress, I don't know a lot about drupal, so this function "drupal_get_private_key" confuses me a little and I can't really find a lot of documentation about it. Could someone explain me what is this function about and how could I do this in Wordpress?
Thank you for the help
Drupal uses this to generate the paths to files* (its used in other stuff too, but in themming I believe its the main reason).
*These files are the files created by users, not the files in the theme folder. The folders are configured in the admin and, when an user uploads a news picture, for example, it will be placed in the configured folder.
You problably just want to find another way to find these paths.

transferring wordpress blog posts from one blog to other including images

I want to move all the blog posts from one wordpress installation to other, I know about the Import/Export option but that does not transfer images, I need to transfer the images.
Please ideas would be helpful
This answer from the Wordpress Forum outlines a good way to do this:
http://wordpress.org/support/topic/migrating-blog-images-to-brand-new-wordpress-site-database
In short, all of your images live in wp-content/uploads. You'll need to combine the uploads folder from your old installation with the uploads folder in the new one, and then change the image URLs within the posts themselves.
It's a bit of a pain, and definitely would be a nice-to-have for them to include images in future versions of the import/export function.

Migrating from Wordpress MU to single site

I have seen alot of information on migrating from wordpress Single User to Multi user but don't see any on migrating from MU to SU. I would be grateful if someone could point me in the right direction. I don't want to have to rebuild the sites manually.
Thanks
Do you mean automatically translate the WPMU sites into individual WP installations? I doubt anything exists. It would involve copying WP files, making necessary directories and creating configuration files, all the DB tables, dealing with the differences in DB and files from WP vs WPMU (image storage, plugins, etc)...
One solution, provided you have a handful of sites and not hundreds, can be to export the blog content via wp-admin > tools > export and importing back via wp-admin > tools > import once you have the new blog running. You will probably have to adjust the path for the images on the exporting XML files to agree with WP directory structure.
Yep, you just use the Export function. It's the easiest way, really.
No scripts exists that I know of, no posts either, because it's just like moving a blog off wordpress.com.
Except you can access the database if you need it.

Resources