Jump to content

php file upload of particular file name from form


amarrgurung

Recommended Posts

Any one please help me...

 

I have three input type file in the form and the values are passed to a function 

 

 

if(isset($_POST['submit'])=='submit')
{
$result=$obj->insertdata($_POST);
}

 

..form

 

 <form method="post" enctype="multipart/form-data">

<input type="file" name="f_image" style="width:220px;"/>

<input type="file" name="ev_image" style="width:220px;"/>

<input type="file" name="ga_thumb_image" style="width:220px;"/>

 

 

My question is how do I send the value of each file one by one to this function 

 

public function file_upload($a, $b, $c)

{

print_r($a);

}

 

from the below function 

 

 

public function insertdata($a)

 

{

 

 

$ev_banner=self::file_upload($_FILES['ev_image'],'ev_image','gallery/banner');
 

 

 

}

 

the answer i am getting is 

Array ( [f_image] => Array ( [name] => [type] => [tmp_name] => [error] => 4 => 0 ) [ev_image] => Array ( [name] => 027.JPG [type] => [tmp_name] => [error] => 1 => 0 ) [ga_thumb_image] => Array ( [name] => [type] => [tmp_name] => [error] => 4 => 0 )

 

I only want 

Array ( [name] => 027.JPG [type] => [tmp_name] => [error] => 1 => 0 )

this out put 

Please help

 

 

 

 

 

 

 

 

 

 

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.