Welcome Guest, Not a member yet? Register   Sign In
best way to upload and rename an image
#13

[eluser]Rick Jolly[/eluser]
[quote author="llbbl" date="1193192203"]
Quote:1) upload to your server’s temp directory (so you won’t have to delete this source image later)
2) get the image info that you want to insert into your database from $this->upload->data();
3) insert that data into your database, then if you are using auto-increment, you can get the unique id using $this->db->insert_id();
4) copy/resize your image to the directory of your choice using the upload data ‘full_path’ as your ‘source_image’ and add the unique id from the database as the new image name (or at least part of it, appending any constant you like to the name). Example: uploads/img_1.jpg, uploads/img_1_thumb.jpg, etc.

look I didn't think you explained it well. its nothing personal, calm down dood. security should always be a top concern, or are you in the habit of giving bad advice? if its outside the web root than say it. jared's code is not outside the web root. I suggest that you in the future you refer people, who want to do file uploading, to read the pdf. It is easier than trying to explain it yourself.[/quote]

Ok, how would you expect me to respond to this:
Quote:how rick jolly suggests to do it, is a bad idea.
when there is absolutely nothing insecure with my advice. Zero.

You assumed that "uploads/" was in the web root without justification. I assume that you are a hairy beast. Oh, and it's nothing personal, calm down dood.


Messages In This Thread
best way to upload and rename an image - by El Forum - 10-23-2007, 01:54 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 02:34 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 02:36 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 02:40 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 02:41 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 02:48 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 02:53 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 02:55 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 03:02 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 03:04 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 03:16 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 03:29 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 04:13 PM
best way to upload and rename an image - by El Forum - 10-23-2007, 07:49 PM
best way to upload and rename an image - by El Forum - 10-24-2007, 10:49 AM
best way to upload and rename an image - by El Forum - 10-24-2007, 12:17 PM
best way to upload and rename an image - by El Forum - 10-24-2007, 02:31 PM
best way to upload and rename an image - by El Forum - 10-24-2007, 03:29 PM
best way to upload and rename an image - by El Forum - 10-24-2007, 03:44 PM
best way to upload and rename an image - by El Forum - 10-30-2007, 04:57 PM
best way to upload and rename an image - by El Forum - 03-22-2008, 02:18 AM
best way to upload and rename an image - by El Forum - 03-24-2008, 10:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB