3

I uploaded my blackberry application's delivarables to a server. I want my users to install the application from an url. Before uploading to remote server i made tests on localhost. No problem. But when i try to download .jad file from server it displays the file content, doesn't intall the application.

Displayed text:

Manifest-Version: 1.0
RIM-COD-Module-Name: .....

I thought it was about mime types so added these lines to .htaccess file in the folder with application files:

Options -Indexes
AddType text/vnd.sun.j2me.app-descriptor .jad
AddType application/vnd.rim.cod .cod
AddType application/java-archive .jar

That didn't solve either. I don't know what else to do.

.cod, .jad, .jar .. files all uploaded.

UPDATE: Solved using php.

$url = 'http://myserver.com/myapp.jad'
$jadContents = "";
try {
      $file = fopen($url, 'r');
      $jadContents = fread($file, filesize($url));
      fclose($file);
} catch (Exception $e) {
        var_dump($e->getMessage());
        $jadContents = "";
}
if ($jadContents != "") {
   header("HTTP/1.1 200 OK", true);
   header("Content-Type: text/vnd.sun.j2me.app-descriptor", true);
   header("Content-Length: " . strlen($jadContents), true);
   echo($jadContents);
}
Muhammet Emre
  • 349
  • 3
  • 17
  • The mime types should do it. Have you confirmed that your web server is really sending the expected mime type in the http headers when retrieving the .jad file? – Scott W Jul 20 '11 at 13:20
  • Is there a way to confirm it from the browser? – Muhammet Emre Jul 20 '11 at 13:26
  • Not that I am aware of, unfortunately. You could throw together a simple app that requests the HTTP link, then debug and check the headers on the HTTP connection while it is open... – Scott W Jul 20 '11 at 17:46
  • 1
    Or, if the URL is public, try this: http://www.webconfs.com/http-header-check.php – Scott W Jul 20 '11 at 17:47
  • You were right. Returned type is text/plain. Thanks for helping. I guess the problem is with apache server but what should i do now? I have no idea. – Muhammet Emre Jul 21 '11 at 06:09
  • Hello Mucie, I am also trying the same task. to use OTA in my app. please can you guide the process.?:( – Sam-In-TechValens Aug 28 '12 at 12:47
  • 1
    Hi @samintechvalens. I solved the issue with using php. I shared the code in the question. Hope it helps. – Muhammet Emre Sep 04 '12 at 11:03

1 Answers1

1

To enable .htaccess file, you need to add

<Directory /somedir>
Allowoverride All
</Directory>

to httpd.conf

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416