Welcome Guest, Not a member yet? Register   Sign In
where i get the information about upload files?
#1

[eluser]Asinox[/eluser]
Hi, im trying to upload file, and all is fine...but now i want to save the information about this file in my data base...but how ill get this information?, ┬┐how i get the name of file? type, etc?

Thansk Smile
#2

[eluser]Seppo[/eluser]
Quote:$this->upload->data()
This is a helper function that returns an array containing all of the data related to the file you uploaded. Here is the array prototype:

Array
(
[file_name] => mypic.jpg
[file_type] => image/jpeg
[file_path] => /path/to/your/upload/
[full_path] => /path/to/your/upload/jpg.jpg
[raw_name] => mypic
[orig_name] => mypic.jpg
[file_ext] => .jpg
[file_size] => 22.2
[is_image] => 1
[image_width] => 800
[image_height] => 600
[image_type] => jpeg
[image_size_str] => width="800" height="200"
)
http://ellislab.com/codeigniter/user-gui...ading.html
#3

[eluser]Asinox[/eluser]
Thanks... but how i pass this data to my function model to save data?

Thanks
#4

[eluser]Seppo[/eluser]
as a parameter? That depends on your code... I don't know what you are doing internally
#5

[eluser]Bramme[/eluser]
[quote author="Asinox" date="1215807912"]Thanks... but how i pass this data to my function model to save data?

Thanks[/quote]$this->upload->data() returns an array...

So you could do:
Code:
$data = $this->upload->data();
$insert['filename'] = $data['file_name'];
$this->db->insert('table', $insert);
#6

[eluser]Asinox[/eluser]
Thanks Smile

Gr8! Smile




Theme © iAndrew 2016 - Forum software by © MyBB