Jump to content

An Image Upload Problem


gotornot

Recommended Posts

I am looking to make an image uploader for my site. I have written the image upload file but its so basic im fearing it will be broken and if someone uploads an image with the same name it will just copy over someone elses.

I also need to check that its either jpeg or gif and maybe downsize the image so no one uploads a 5meg phot from a digital camera and crashes the site.

Does anyone have any ideas how to do the 3 things above?

Link to comment
Share on other sites

1. you can check to see if same name exists before 'moving' the image and if it does, simply generate a new name.

 

2. yes, you can easily add the ability to check image type

 

3. yes, you can either reject or resize images during your upload process.

 

Sooooo.... the secret is A. Show us your existing code B. do a google search of 'php resize image' 'php upload image unique name'    'php upload image restrict type'. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.