Welcome Guest, Not a member yet? Register   Sign In
file upload - missing character
#1

[eluser]cotejf[/eluser]
Hi guys,
the first character of the file name being uploaded is missing and I don't understand...

Here is the form:
Code:
<?php
echo form_open_multipart('sro/add_file_sro', array('class'=>'form'));
echo form_hidden('file_actual_url', current_url());
echo form_hidden('file_cm_no', $sro->NO);
?>
<p>
<label for="file_title">Titre</label>
&lt;input  size=30 type="text" name="file_title" id="file_title" value="&lt;?php echo set_value('file_title'); ?&gt;"&gt;
</p>
<p>
<label for="file_desc">Description</label>
&lt;textarea cols=30 rows=5 type="file_desc" name="file_desc" id="file_desc"&gt;&lt;?php echo set_value('file_desc'); ?&gt;&lt;/textarea&gt;
</p>
&lt;input class="" type="file" id="userfile" name="userfile" size="100"&gt;
&lt;input class="big-button red" type="submit" value="Save" /&gt;
&lt;/form&gt;

uploaded file name:
Code:
exemple_63428886.pdf


My controller:
Code:
$filename=$_FILES['userfile']['name'];
var_dump($_FILES);
die();

Result of $_FILES :
Code:
array
  'file_name' => string 'xemple_63428885.pdf' (length=19)
  'file_type' => string 'application/pdf' (length=15)
  'file_path' => string 'C:/wamp/www/web/tech/fichiers/6159109/' (length=38)
  'full_path' => string 'C:/wamp/www/web/tech/fichiers/6159109/xemple_63428885.pdf' (length=57)
  'raw_name' => string 'xemple_63428885' (length=15)
  'orig_name' => string 'xemple_6342888.pdf' (length=18)
  'client_name' => string 'xemple 6342888.pdf' (length=18)
  'file_ext' => string '.pdf' (length=4)
  'file_size' => float 16.86
  'is_image' => boolean false
  'image_width' => string '' (length=0)
  'image_height' => string '' (length=0)
  'image_type' => string '' (length=0)
  'image_size_str' => string '' (length=0)

You can see the first letter is missing.

Instead of exemple_63428886.pdf I get xemple_63428886.pdf (e is missing)

Any help will be appreciated.

Thanks
#2

[eluser]cotejf[/eluser]
bump




Theme © iAndrew 2016 - Forum software by © MyBB