Articles of uploads

Deny access to uploads folder with exceptions

On a members only site logged in members can access the files in the uploads folder, if not logged in they are redirected to the login screen. I’m using the following in the .htaccess file to do that: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?http://example\.com/ [NC] RewriteCond %{REQUEST_URI} !hotlink\.(doc|xls|pdf|html|htm|xlsx|docx|mp4|mov|rtf|ppt|pptx) [NC] RewriteCond %{HTTP_COOKIE} […]

How to make picture appear on wordpress site shared link?

I would like to know how to make a piture appear on the thumbnail to the left of the text when I share a link of my wordpress on facebook. I dont post any images to the website, but would still like for a pic to appear there (instead of having a blank square).

How to load attachment in media library for current user?

i’m using (media library) in my theme on Frontend. It’s possible load only attachment of current user logged? For example, my wp user id is 55 and load only my attachment and not others by different users? There isn’t a documentation about how work js in WP…

Location of image metadata on my server

To clean up my media library, I deleted some unused pictures directly out of my uploads folder. Now, whenever I go to the media library the file names are still there but the thumbnails have been deleted: http://img.mywordpresstips.com/database/lzCLiF.jpg Where is the image metadata stored on my server so that I can delete it there.

Add pdf to a website

I’m building a website containing a lot of pdf files, i added those files with add media button when creating a page, my question is when i open that page, does it mean in my navigator that i charged those files ( my site will be super slow ) ? or the pdf file will […]

Error: The uploaded file exceeds the upload_max_filesize directive in php.ini

This question already has an answer here: Increase Size Limit of Media Files WordPress 4.1 1 answer

Blob file download problem

I’m currently trying to download a blob archive file saved in the database $fid = $_GET[‘fid’]; $sel = $wpdb->get_results( “SELECT * FROM uploads WHERE id = $fid” ); foreach( $sel as $head ) { $name = $head->name; $type = $head->type; $size = $head->size; $content = $head->content; header(“Content-length: $size”); header(“Content-type: $type”); header(“Content-Transfer-Encoding: Binary”); header(“Content-Disposition: attachment; filename=$name”); […]

How to restrict wp generate attachment metadata() to certain intermediate image sizes

In WordPress, we have added our own intermediate image sizes to the standard WordPress sizes using add_image_size(). Using our own admin interface to upload images, we then use wp_generate_attachment_metadata() to create all thumbnails and save them to a predefined folder on the server. However, we would like to restrict wp_generate_attachment_metadata() to generate our custom defined […]

WordPress Bug on IIS ? Problem when uploading image on IIS 7

When I upload image, I can preview it, but once it’s uploaded, It’s broken in post, I’m obliged to go to the directory and go to security to add NETWORK SERVICES the right to access the picture. How to fix this ? Is this a bug ?

WordPress function when file is uploaded, deleted or edited

I need to call this bit of PHP when a file is uploaded, deleted or edited. $output = shell_exec(“bash ./upload.sh”); echo $output; I can’t seem to find the right code to execute this when any of the above happen. Examples and help would be greatly appreciated.