Php 图像上载在CodeIgniter中不起作用
当我点击按钮,然后它会返回错误,您并没有选择一个文件上传。我的图片没有上传! 现在请帮帮我,我能做什么 我的观点是Php 图像上载在CodeIgniter中不起作用,php,codeigniter,Php,Codeigniter,当我点击按钮,然后它会返回错误,您并没有选择一个文件上传。我的图片没有上传! 现在请帮帮我,我能做什么 我的观点是 <form action="insertform" enctype="multipart" name="form" method="post" id="contact-form" class="form-horizontal"> <div class="control-group"> <label class="control-labe
<form action="insertform" enctype="multipart" name="form" method="post" id="contact-form" class="form-horizontal">
<div class="control-group">
<label class="control-label" for="name">Image Upload:</label>
<div class="controls">
<input type="file" class="input-large" name="image" id="image">
</div>
<form>
我认为文件输入名应该是userfile,而不是image CI文件上载文件控件默认名称为userfile 如果要将其名称更改为自定义名称,则必须传递新名称以上载功能,如:
if ( ! $this->upload->do_upload("image")) // image is your new name for file control
首先,
将do_upload函数调用更改为:
if ( ! $this->upload->do_upload('image'))
或
将输入名称更改为:
<input type="file" class="input-large" name="userfile" id="image">
<input type="file" class="input-large" name="userfile" id="image">
enctype="multipart/form-data"