SoftHub
November 23, 2023, 2:59am
21
You found it out by youself, there’s several more and messing with .htaccess doesn’t help.
Tried to set manually a tmp folder for myself and didnt help.
php_value upload_tmp_dir /home/vol00_0/infinityfree.com/if0_00000000/softhub.xyz/htdocs/tmp
and that didn’t help, guess we’ll have to wait for the admin to tweak that php.ini
1 Like
@ifastnet hello
Please Check php.ini file or hosting system because I also have this problem even though my script is correct and it was working.
Herbert
November 23, 2023, 3:52am
23
Hey there, Please keep in mind that users can’t edit or view the php.ini file due to security reasons. As I mentioned before, we are all going to have to wait until the admin fixes this issue.
The php.ini file is not accessible from within your account. The php.ini file contains the PHP settings for all accounts on the server, so we cannot let you access or modify it. PHP settings unfortunately cannot be changed for individual accounts.
YT_Xaos
November 23, 2023, 5:14am
24
Try this code:
if(empty($_FILES["imageupload"])) {
exit("File is empty.");
}
$targetDir = $_SERVER["DOCUMENT_ROOT"]."/images/".basename($_FILES["imageupload"]["name"]);
if(move_uploaded_file($_FILES["imageupload"]["tmp_name"], $targetDir)) {
echo "Successfully uploaded ".$_FILES["imageupload"]["name"].".";
} else {
echo $_FILES["imageupload"]["error"]);
}
Herbert
November 23, 2023, 6:16am
25
Like I said before, it’s not an issue with the code; something is wrong with the php.ini.
And your code would be more clear and would prevent any errors if you used it like this.
$targetDir = $_SERVER["DOCUMENT_ROOT"] . "/images/";
$targetFile = $targetDir . basename($_FILES["imageupload"]["name"]);
1 Like
YT_Xaos
November 23, 2023, 2:44pm
26
I don’t think anything is wrong with the php.ini file because it works just fine for me.
1 Like
Herbert
November 23, 2023, 4:59pm
27
No, there is something wrong with the PHP. My apologies for not addressing it correctly.
1 Like
system
Closed
November 30, 2023, 7:23pm
29
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.