Global Text Uploads Not Working (v. 2.5 - 2.62)
If, when uploading a text file through the global uploads in your administration area, you're getting the error "Sorry, but you can only upload a Tab-Delimited text file here. Please try again", your server may not recognize a text upload. Please upgrade your system, or manually change your existing file as follows:
-
Open the global.php page in the /storeadmin/ area
-
Remove the text file checker by changing the lines:
if ($_FILES['uploadfile']['type'] != "text/plain" OR $txttype != ".txt") echo "Sorry, but you can only upload a Tab-Delimited text file here. Please try again."; else if ($_FILES['uploadfile']['size'] > "100000")
to:
// if ($_FILES['uploadfile']['type'] != "text/plain" OR $txttype != ".txt") // echo "Sorry, but you can only upload a Tab-Delimited text file here. Please try again."; if ($_FILES['uploadfile']['size'] > "100000")
If you are not able to upload files (such as the sample file) because items with single quotes aren't updating, change the lines:
$fieldname = addslash_mq($fields[$f]);
$fieldname = str_replace('""', '"', $fieldname);
$fieldname = str_replace('"', '', $fieldname);
$fieldname = str_replace('"', '"', $fieldname);
to:
$fieldname = stripslashes($fields[$f]);
$fieldname = str_replace('""', '"', $fieldname);
$fieldname = str_replace("''", "'", $fieldname);
$fieldname = str_replace("'", "''", $fieldname);
$fieldname = trim($fieldname, '"');