Codeigniter の組み込みアップロード ライブラリを使用しています。これらは私のアップロード設定です:
$config['upload_path'] = upload_path() . 'incoming_faxes/';
$config['allowed_types'] = 'xml|pdf';
$config['file_name'] = uniqid('fax-' . time() . '-', true) . '.xml';
$this->load->library('upload', $config);
それは機能します。返されるデータは以下のとおりですfile_name
が、アンダースコアが追加されています。
Array
(
[file_name] => fax-1377114300-521518bca7c5a7.65243756_.xml
[file_type] => application/xml
[file_path] => /var/www/vhosts/example.org/httpdocs/uploads/incoming_faxes/
[full_path] => /var/www/vhosts/example.org/httpdocs/uploads/incoming_faxes/fax-1377114300-521518bca7c5a7.65243756_.xml
[raw_name] => fax-1377114300-521518bca7c5a7.65243756_
[orig_name] => fax-1377114300-521518bca7c5a7.65243756_.xml
[client_name] => Sample.xml
[file_ext] => .xml
[file_size] => 84.69
[is_image] =>
[image_width] =>
[image_height] =>
[image_type] =>
[image_size_str] =>
)
ファイルがサーバーにアップロードされる前にアンダースコアを削除するにはどうすればよいですか?