Jump to content

Wordpress Upload PHP file code


groogruxking40

Recommended Posts

Hello there

 

site: www.christiancouriernewspaper.com

 

Wordpress- 2.8

 

I need a code that lets my customers upload a image file from their computer and then that file does 2 things

 

1. gets uploaded to upload folder on my server

2. a copy of that file gets e-mailed to me

 

this is what I have so far, any improvements/additions on this code would really be appreciated...

 

1.//GET IMAGE INFO

2.

3.    $dir = 'images/';

4.    $file_name = $_FILES['file']['name'];

5.    $file_tmp = $_FILES['file']['tmp_name'];

6.   

7.    //CHECK FOR UPLOADED FILE

8.    if(is_uploaded_file($file_tmp)){

9.        //MOVE TO DIR

10.        move_uploaded_file($file_tmp, $dir.$file_name);

11.            }

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.