Advertisement
bhengh

SB Android fix 1: new code

Sep 12th, 2013
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
  2. $download_file_name = $file_name;
  3. if (stripos($user_agent, 'android') !== false) {
  4. $file_name_array = explode('.', $file_name);
  5. $last_key = count($file_name_array) - 1;
  6. $file_name_array[$last_key] = strtoupper($file_name_array[$last_key]);
  7. $download_file_name = implode('.', $file_name_array);
  8. }
  9. header('Content-Disposition: attachment; filename="'.$download_file_name.'"');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement