Jump to content

How to disable file upload rename in contact form?


justic3

Recommended Posts

Hi, may I know how to disable  file to rename?   in state of rename can i change to order refence no?

 if (isset($fileAttachment['rename']) && !empty($fileAttachment['rename']) && rename($fileAttachment['tmp_name'], _PS_UPLOAD_DIR_.basename($fileAttachment['rename'])))
{
	$cm->file_name = $fileAttachment['rename'];
	@chmod(_PS_UPLOAD_DIR_.basename($fileAttachment['rename']), 0664);
}

I tried to add   $fileAttachment['rename'] = $order->getUniqReference(),  before the code above and it works, but the file does not have file extension.

 

How to save the filename as   {order reference no} + {tmp_name}

Link to comment
Share on other sites

×
×
  • Create New...