Database Library and File uploading Library Questions

Hello there,
I've got two questions; one for each library! :-)

First of all, in the database library it is said that the values, when inserted using the active record method, are automatically escaped. I have inserted values into a table, and when I look at the table, I see nothing escaped... is it only for HTML tags and such?
Also, should I sanitize the data (make sure it is not going to mess with the query sent to the database), or it will be done automatically, too?

My second question is about the file uploading class, as promised! :-)
Imagine we have a file called image1.jpg in the upload folder. I go and upload a file with the same name, and since in the PHP script overwrite is false, it won't be overwritten. All fine up to this point. However, will the $this->upload->data() function return the file name in the uploader's computer (I.E. image1.jpg), or the renamed file name?


1. CI sanitizes your input data automatically
2. With $this->upload->data() you can get both, the original and renamed name of the file

Hi there,
Thanks a lot for the quick reply! So, what you are saying is that orig_name (if I remember correctly) shows the original name -- the one on the client's computer, and $this->upload->data('full_path') gives the path to the renamed file? Or is it different? I remember reading that orig_name is only useful for the times you are encrypting the file name.

gives you the original (initial) name of the file (before it gets renamed.
to get the renamed version of the name (if it has been renamed)

gives the full path including the file name, in the server (with the renamed name)

Thank you! All fixed. :-)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.