Handle image file and save it to media

What I did was to get media folder and save there the cropped image. After that update meta data: $imageToCropPath= get_attached_file($attachmentId); // Get file path to the image that will be cropped $img = imageCreateFromJpeg($imageToCropPath); $croppedImage = imagecrop($img, [‘x’ => $cropX, ‘y’ => $cropY, ‘width’ => $cropWidth, ‘height’ => $cropHeight]); $uniqueId = md5(uniqid()); // Create … Read more

Picture upload issue – broken thumbnail

This is not something that can be answered without more info. What exactly means “uploaded by FTP”? Do you upload the files and then manually insert the address into the Source Code? What happens if you / the client directly tries to access the files by typing in the URL into the Browser Address Bar? … Read more

Where to store sensitive uploaded file?

Upload files at anywhere ( normally create your own folder inside wp-content/uploads folder ), you can create .htaccess file and index.html files inside the folder to restrict the files from direct access. Keep index.html blank and add deny from all text in .htaccess file.