/upload.php Secret
Last active
July 11, 2017 15:36
Star
You must be signed in to star a gist
File upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( | |
$_FILES['file']['size'] > 0 && | |
is_uploaded_file( $_FILES['file']['tmp_name'] ) && | |
preg_match( '/\.(jpe?g|gif|bmp|png)$/i', $_FILES['file']['name'], $m ) | |
) { | |
// .. | |
$original_name = $original_name . intval( $artwork_id ); | |
$name_template = $name_template . intval( $artwork_id ); | |
// ... | |
$output = $original_name.'.jpg'; // the original file | |
$preview = $name_template.'.preview.jpg'; // the modified files | |
move_uploaded_file( $_FILES['file']['tmp_name'], $output ); | |
$command = "$convert_location $output -resize 200x200 $preview"; | |
exec( $command ); | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment