Welcome Guest, Not a member yet? Register   Sign In
Uploading 2 files
#1

[eluser]peekk[/eluser]
Hi!
I have problem when i want to upload more than 1 file on my server, i have two fields for files in my form (userfile, userfile_watermark) my uploading code is:

Code:
if($_FILES['userfile_watermark']['size']>0){
$new_filename_watermark = $this->file_name($_FILES['userfile_watermark']['name']);
$config['upload_path'] = './sounds/watermark';
$config['allowed_types'] = 'mp3|wav';
$config['file_name'] = $new_filename_watermark;
$this->load->library('upload', $config);
$this->upload->do_upload();
}

  
if($_FILES['userfile']['size']>0){
$new_filename = $this->file_name($_FILES['userfile']['name']);
$config['upload_path'] = './sounds';
$config['allowed_types'] = 'mp3|wav';
$config['file_name'] = $new_filename;
$this->load->library('upload', $config);
$this->upload->do_upload();
}

and both files are uploaded to /sounds/watermark/ and their names are $new_filename_watermark (one should be just: $new_filename). I see that i want to load my library two times and probably that's wrong. How can i reload this or something like that?

Cheers!


Messages In This Thread
Uploading 2 files - by El Forum - 03-21-2012, 02:27 AM
Uploading 2 files - by El Forum - 03-21-2012, 03:00 AM
Uploading 2 files - by El Forum - 03-21-2012, 03:32 AM
Uploading 2 files - by El Forum - 03-22-2012, 05:48 AM
Uploading 2 files - by El Forum - 03-22-2012, 06:00 AM
Uploading 2 files - by El Forum - 03-22-2012, 06:19 AM
Uploading 2 files - by El Forum - 03-22-2012, 06:25 AM
Uploading 2 files - by El Forum - 03-22-2012, 08:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB