Attachments
Moderator: mkoch227
Attachments
Script URL: http://Internal IP/CASHS_HELPDESK
Version of script: 2.2
Hosting company: ME
URL of phpinfo.php: http://Internal IP/CASHS_HELPDESK/phpinfo.php
URL of session_test.php: http://Internal IP/CASHS_HELPDESK/session_test.php
What terms did you try when SEARCHING for a solution: Attachments
Write your message below:
Ok, we have a problem with adding attachments. This worked fine before the upgrade. I have searched the knowledgebase and also followed the instructions of the sticky.
The error message I get when wanting to attach a file is.
'Cannot move file to the attachments folder, please check your server path settings'
I used the path.php and entered the settings in Hesk.
I have also changed the security permissions in the attachments folder and the the file hesk_settings.inc.php.
I followed the instructions to the book. I don't really want to revert to the back up as yet as I'm sure someone might be able to help me.
Thank You
Version of script: 2.2
Hosting company: ME
URL of phpinfo.php: http://Internal IP/CASHS_HELPDESK/phpinfo.php
URL of session_test.php: http://Internal IP/CASHS_HELPDESK/session_test.php
What terms did you try when SEARCHING for a solution: Attachments
Write your message below:
Ok, we have a problem with adding attachments. This worked fine before the upgrade. I have searched the knowledgebase and also followed the instructions of the sticky.
The error message I get when wanting to attach a file is.
'Cannot move file to the attachments folder, please check your server path settings'
I used the path.php and entered the settings in Hesk.
I have also changed the security permissions in the attachments folder and the the file hesk_settings.inc.php.
I followed the instructions to the book. I don't really want to revert to the back up as yet as I'm sure someone might be able to help me.
Thank You
Last edited by JonnyEQ on Mon Jul 12, 2010 8:58 am, edited 4 times in total.
Unfortunately we can't be of much help unless you provide the information you were asked for (both in this and the other topic you opened):
Script URL:
URL of phpinfo.php:
You will find phpinfo file in the "READ THIS BEFORE POSTING" topic.
Script URL:
URL of phpinfo.php:
You will find phpinfo file in the "READ THIS BEFORE POSTING" topic.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
You will need to change "http://x.x.x.x" with an actual IP address or domain, so we can see the results 

Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Hi Klemen, it's hosted internally on our intranet. Sorry.Klemen wrote:Unfortunately we can't be of much help unless you provide the information you were asked for (both in this and the other topic you opened):
Script URL:
URL of phpinfo.php:
You will find phpinfo file in the "READ THIS BEFORE POSTING" topic.
Can you let me know what you entered for the server path?
If you use Windows IIS also read this:
viewtopic.php?t=1406
If you use Windows IIS also read this:
viewtopic.php?t=1406
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Hi Klemen, I already checked the link and everything is fine regarding the permissions.Klemen wrote:Can you let me know what you entered for the server path?
If you use Windows IIS also read this:
viewtopic.php?t=1406
The server path is: C:/wamp/www/Cashs_HELPDESK
I definitely need more info about the error then. Try this:
- backup your hesk_settings.php file
- manually edit the hesk_settings.php file: open it in Notepad and change to
Then try uploading an attachment again and let me know if you get any other error messages.
- backup your hesk_settings.php file
- manually edit the hesk_settings.php file: open it in Notepad and change
Code: Select all
if ($hesk_settings['debug_mode'])
{
error_reporting(E_ALL ^ E_NOTICE);
}
else
{
ini_set('display_errors', 0);
ini_set('log_errors', 1);
}
Code: Select all
error_reporting(E_ALL);
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Hi Klemen, I changed the code in the hesk_settings.php file and I still get the same message saying.Klemen wrote:I definitely need more info about the error then. Try this:
- backup your hesk_settings.php file
- manually edit the hesk_settings.php file: open it in Notepad and changetoCode: Select all
if ($hesk_settings['debug_mode']) { error_reporting(E_ALL ^ E_NOTICE); } else { ini_set('display_errors', 0); ini_set('log_errors', 1); }
Then try uploading an attachment again and let me know if you get any other error messages.Code: Select all
error_reporting(E_ALL);
Error:
Cannot move file to the attachments folder, please check your server path settings

Jonah
Ok, here's the last thing we can try:
open submit_ticket.php in Notepad and change to and also paste this inside the submit_ticket.php file just above the very last ?>
Try to attach something as customer and let me know what it says.
open submit_ticket.php in Notepad and change
Code: Select all
hesk_error($hesklang['cannot_move_tmp']);
Code: Select all
die("DEBUG:<br><br>FILES:<br>".nl2br(print_r($_FILES,true))."<br><br>COPY TO: ".$hesk_settings['server_path'].'/attachments/'.$file_name."<br><br>IS WRITABLE: ".(is__writable($hesk_settings['server_path'].'/attachments/') ? 'YES' : 'NO'));
Code: Select all
function is__writable($path) {
if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
return is__writable($path.uniqid(mt_rand()).'.tmp');
else if (is_dir($path))
return is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
// check tmp file for read/write capabilities
$rm = file_exists($path);
$f = @fopen($path, 'a');
if ($f===false)
return false;
fclose($f);
if (!$rm)
unlink($path);
return true;
}
Try to attach something as customer and let me know what it says.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Hi Klemen, I do not have this line in my file. Where it does say hesk_error, this is folloowed by an underscore and buffer. So it reads 'hesk_error_buffer'. Even when it says this. I cannot see anything which reads cannot_move.Klemen wrote:Ok, here's the last thing we can try:
open submit_ticket.php in Notepad and change.Code: Select all
hesk_error($hesklang['cannot_move_tmp']);

Oh, sorry, it's in the inc/attacmnets.inc.php file.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Do I place this code below in the attachments file as well?Klemen wrote:Oh, sorry, it's in the inc/attacmnets.inc.php file.
Code: Select all
function is__writable($path) {
if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
return is__writable($path.uniqid(mt_rand()).'.tmp');
else if (is_dir($path))
return is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
// check tmp file for read/write capabilities
$rm = file_exists($path);
$f = @fopen($path, 'a');
if ($f===false)
return false;
fclose($f);
if (!$rm)
unlink($path);
return true;
}
I entered it into the attachments file. I then tried to attach a file and got this.Klemen wrote:Oh, sorry, it's in the inc/attacmnets.inc.php file.
DEBUG:
FILES:
Array
(
[attachment] => Array
(
[name] => Array
(
[1] => Crystal Reports Reporting Services Overview.doc
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
)
[type] => Array
(
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
)
[tmp_name] => Array
(
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
)
[error] => Array
(
[1] => 1
[2] => 4
[3] => 4
[4] => 4
[5] => 4
[6] => 4
[7] => 4
)
[size] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
)
)
)
COPY TO: C:/wamp/www/Cashs_HELPDESK/attachments/A1ZP6AGBQJ_45e5a92131f6000dcb1cf50abc526ab5.doc
IS WRITABLE: YES
Hope this helps.
Cheers.
The file wasn't uploaded because the uploaded file size exceeds the upload_max_filesize directive in php.ini.
http://www.php.net/manual/en/features.f ... errors.php
(VALUE 1)
So the entire thing errors out before it can even be handled by Hesk.
http://www.php.net/manual/en/features.f ... errors.php
(VALUE 1)
So the entire thing errors out before it can even be handled by Hesk.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools