在CI中检索文件扩展名时出现问题 [英] problems retrieving file extension in CI

查看:148
本文介绍了在CI中检索文件扩展名时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在上传时检索图片的文件扩展名?



我没有上传任何问题,只需检索文件扩展名



感谢

解决方案 div>

  $ name_of_file_with_extn = $ this-> upload-> data('file_name')

您可以从以下列表中更改项目名称



file_name上传文件的名称,包括文件扩展名
file_type文件MIME类型标识符
file_path文件的绝对服务器路径
full_path绝对服务器路径,包括文件名
raw_name文件名,不带扩展名
orig_name原始文件名。这只有在您使用加密名称选项时才有用。
client_name在任何文件名准备或增加之前由客户机用户代理程序提供的文件名
file_ext文件名扩展名,包含句点
file_size文件大小(以KB为单位)
is_image文件是否是图像。 1 =图像。 0 =不。
image_width图像宽度
image_height图像高度
image_type图像类型(通常是不带句点的文件扩展名)
image_size_str一个包含宽度和高度的字符串标签)



这可能会对您有所帮助。


How can I retrieve the file extension of an image while uploading?

I don't have any problems with the upload, just retrieving the files extension , which would be useful when creating thumbnails dynamically.

Thanks

解决方案

 $name_of_file_with_extn =  $this->upload->data('file_name')

you can change the item name from the below list

file_name Name of the file that was uploaded, including the filename extension file_type File MIME type identifier file_path Absolute server path to the file full_path Absolute server path, including the file name raw_name File name, without the extension orig_name Original file name. This is only useful if you use the encrypted name option. client_name File name as supplied by the client user agent, prior to any file name preparation or incrementing file_ext Filename extension, period included file_size File size in kilobytes is_image Whether the file is an image or not. 1 = image. 0 = not. image_width Image width image_height Image height image_type Image type (usually the file name extension without the period) image_size_str A string containing the width and height (useful to put into an image tag)

This might help you.

这篇关于在CI中检索文件扩展名时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆