I have a simple PHP file upload script to upload files. It was working fine, but after a change to PHP settings, the script is not uploading files, although I dont get any error and it says it was uploaded successfully. The script seems to be doing its job, but I cant see any files in my uploads folder. Nothing is changed in script since it was working other than a change in php settings where I had to request my host to do following the following PHP settings:
max_execution_time 60
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M
allow_url_fopen = On (this was the last change, which I believe is the causing the issue).
Here is my upload script:
$ds = DIRECTORY_SEPARATOR;
$storeFolder = "uploads/";
$fileupload = basename( $_FILES['file']['name']);
$fileType = $_FILES['file']['type'];
$fileSize = $_FILES['file']['size'];
$tempFile = $_FILES['file']['tmp_name'];
$targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds;
$targetFile = $targetPath. $fileupload;
move_uploaded_file($tempFile,$targetFile);
Note: I am not trying to upload a huge file, Like I said, the script doesn't through any error, but I cant see the files in my uploads folder.
I am not even sure if this is because of my PHP settings changes. Any help is highly appreciated!
allow_url_fopen? What's your intention and did it serve your purpose else why not go without it? just asking