Welcome Guest, Not a member yet? Register   Sign In
$mp3config['encrypt_name'] = TRUE not encoding?
#1

[eluser]stevenazari[/eluser]
Hi guys,

I'm trying to bug fix an mp3 uploading issue and I've narrowed it down to the following problem.

Code:
//Upload config setup
$mp3config['upload_path'] = './media/audio/';
$mp3config['allowed_types'] = 'mp3|MP3';
$mp3config['max_size'] = '0';
$mp3config['encrypt_name'] = TRUE;
$mp3config['remove_spaces'] = TRUE;
$this->upload->initialize($mp3config);
//End of config

//Do upload and assign array
$this->upload->do_upload('bandtrackfile');
$bandtrackupload = $this->upload->data();
$date = time();
                
// Do S3 audio/mpeg
if (!is_file($bandtrackupload['full_path']))
   {
   echo "An error has occured please inform the web master on [email protected] and send the below information:<br>";
   echo "Bandtrackupload:<br>";
   print_r ($bandtrackupload);
   die();
   }

OK so there is the upload configuration which to my knowledge is correct and an if statement to check if its right... Now when I and my colleagues try uploading mp3s we have no problems. But we keep getting reports from users with the following messages:

Code:
An error has occurred please inform the web master on [email protected] and send the below information:
Array (
       [file_name]      => Sunshine No Intro.mp3
       [file_type]      => audio/mp3
       [file_path]      => /home/gq36staa/web/public/media/audio/
       [full_path]      => /home/gq36staa/web/public/media/audio/Sunshine No Intro.mp3
       [raw_name]       => Sunshine No Intro
       [orig_name]      =>
       [file_ext]       => .mp3
       [file_size]      => 4720.12
       [is_image]       =>
       [image_width]    =>
       [image_height]   =>
       [image_type]     =>
       [image_size_str] =>
      )

now I done a test to deliberately get that error and when I do I get the following array information:

Code:
An error has occured please inform the web master on [email protected] and send the below information:
Bandtrackupload:
Array (
      [file_name]      => 166c4dea8e99da2469d7cc2b4bcd712c.mp3
      [file_type]      => audio/mpeg
      [file_path]      => /home/gq36staa/web/public/media/audio/
      [full_path]      => /home/gq36staa/web/public/media/audio/166c4dea8e99da2469d7cc2b4bcd712c.mp3
      [raw_name]       => 166c4dea8e99da2469d7cc2b4bcd712c
      [orig_name]      => testcase.mp3
      [file_ext]       => .mp3
      [file_size]      => 14.33
      [is_image]       =>
      [image_width]    =>
      [image_height]   =>
      [image_type]     =>
      [image_size_str] =>
      )

From what I can see the file name is not being encoded nor is the spaces being removed which to me suggests the code is looking for the renamed version of the file but only the original file is there... if it is uploaded at all...

Does anyone know why this is an issue with some of my members and not with others? I haven't upgraded code igniter and not entirely sure how to be honest (I'm self learning and picked up from a previous developer) I've been here a year so not sure what has changed since then...

Any help would be amazing
#2

[eluser]stevenazari[/eluser]
Also, looking in the temp upload path ('./media/audio/') I see no file by the name of "Sunshine No Intro.mp3" I assume it's because it's a temporary path and gets deleted after so long/user leaves/script leaves etc but it would have been nice to see that the file was actually there.
#3

[eluser]stevenazari[/eluser]
please? anyone?
#4

[eluser]rogierb[/eluser]
Have you checked things like allowed file size etc?
It might very well be a file not uploading, thus not encoding.

If upload fails it can be a number of thing:
- All the .ini stuff regarding post and upload
- strange filenames
- mimetypes

Did you include:
.mp3 audio/mpeg3
.mp3 audio/x-mpeg-3
.mp3 video/mpeg
.mp3 video/x-mpeg
#5

[eluser]stevenazari[/eluser]
hey there! thanks for helping out!

in the config the file size above is set to 0 (I guess that's infinite size) but I have had people try to upload a 400kb file and they still get the same error - despite me uploading a 8mb file so I don't think it's a size issue.

I have also received the files the users tried uploading to which I have no problems uploading myself nut their attempts fail...

I think the temp file is uploading as we get:
Code:
[full_path] => /home/gq36staa/web/public/media/audio/Sunshine No Intro.mp3

would that still return if the file never uploaded?
#6

[eluser]rogierb[/eluser]
Quote:[full_path] => /home/gq36staa/web/public/media/audio/Sunshine No Intro.mp3

I guess the isn't uploaded otherwise you wouldn't get the error message on
Code:
!is_file($bandtrackupload['full_path']

Have you check what OS,browsers and browser versions these user use? Also check their plugins/toolbars.
Maybe it's something stupid like some toolbar doing something to a file being uploaded.
#7

[eluser]stevenazari[/eluser]
yes, 3 have said firefox but they have tried in internet explorer and safari with the same result...
#8

[eluser]rogierb[/eluser]
Have you tried from different locations? If they cannot upload but you can, maybe it has something to do with ISP?( yeah reaching here... ) Or OS? It seems like a problem of how the server recieves the file.
#9

[eluser]stevenazari[/eluser]
I agree, although I have checked one guys country (australia) and there are many uploads from other users in that area.

I haven't thought about the os giving a problem although thinking about it could be an issue... I haven't checked what os these users are using - will ask them. Shame there's no definitive list of what could stop php uploading. I could atleast give them a informative questionnaire for them to fill out Confused will come back with findings
#10

[eluser]rogierb[/eluser]
Come to think of it, what if the file get's uploaded but your server doesn't "recognize" the file because of for instance localization or case sensitive issues? Maybe you could generate a "ls -l" log each time a file is uploaded and clear is when the file id uploaded correctly. This way you can see IF the file is uploaded and maybe even get you one step further in tracking down the problem.




Theme © iAndrew 2016 - Forum software by © MyBB