Discussion Forums  >  BT.com Website, Account Questions

Replies: 11    Views: 157

Bakkmo
Aspiring developer
Profile
Posts: 52
Reg: Oct 11, 2011
Randaberg
2,670
03/07/14 02:14 AM (7 years ago)

Push .PEM error

Trying to upload a .PEM file for push to an app and i get this error:

Invalid File Type. .pem files only.

I made the file as it should be from help docs on BT site..

Any Clue?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/07/14 07:15 AM (7 years ago)
I ran into this problem and it bugged the heck out of me for a while! Turns out I had to change browsers. It "should" work just fine in FF, Safari or Chrome, but IE seems to have issues. It's completely a matter of the browser recognizing the pem file type.

Try different browsers until it works! Safari ended up doing the trick for me.

Mark
 
Bakkmo
Aspiring developer
Profile
Posts: 52
Reg: Oct 11, 2011
Randaberg
2,670
like
03/07/14 07:20 AM (7 years ago)
i am on Macbook Air, trying in chrome and safari, no luck.. Strange.. i just renewed my membership, can it be some in my account profile?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/07/14 07:42 AM (7 years ago)
Like I mentioned, it's not related to your Buzztouch membership, or even the Apple Developer membership. Now that you mention using a Mac, that's the platform I was having problems with as well. As soon as I switched over to a browser on Windows, it worked just fine (though I still think I had to try a couple browsers). Hopefully you have access to a Windows machine.

It's all related to the browser recognizing the .pem file type. I've seen mention of this on stackoverflow.com as well, but haven't delved in to a fix yet.

Mark
 
Bakkmo
Aspiring developer
Profile
Posts: 52
Reg: Oct 11, 2011
Randaberg
2,670
like
03/07/14 07:48 AM (7 years ago)
i am on Macbook Air, trying in chrome and safari, no luck.. Strange.. i just renewed my membership, can it be some in my account profile?
 
Bakkmo
Aspiring developer
Profile
Posts: 52
Reg: Oct 11, 2011
Randaberg
2,670
like
03/07/14 11:18 AM (7 years ago)
getting frustrated now, tried ie, ff,chrome,safari on both mac and windows pc, same error.. grrr
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2938
Reg: Jul 11, 2012
Cerritos
37,880
like
03/07/14 11:41 AM (7 years ago)
Perhaps you have a bad PEM File?

Is the error such that it won't upload?

Self-hosted? If yes, are the file and directory Read-write permissions correct in the BT installation?
 
Bakkmo
Aspiring developer
Profile
Posts: 52
Reg: Oct 11, 2011
Randaberg
2,670
like
03/07/14 11:43 AM (7 years ago)
i followed the help document on the BT site to make the PEM file, it is made correctly, when i click upload it says that i can only upload a .pem file, and i am trying to upload abcdef.pem
 
Bakkmo
Aspiring developer
Profile
Posts: 52
Reg: Oct 11, 2011
Randaberg
2,670
like
03/07/14 11:44 AM (7 years ago)
this is on the BT site, not the self hosted
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/07/14 01:13 PM (7 years ago)
This bugged me for a while as well, and then eventually it uploaded on the Windows machine. I know I tried many frustrating times. I have no idea how to fix it, unfortunately. :-(

Mark
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/08/14 09:41 AM (7 years ago)
This is the fix from TimWolf It happened to me and worked to fix it.
You will need to go through ftp

FIXED:

In BT-server/bt_v15/bt_app

change line 431 of file: bt_pushNotifications.php

<<OLD>>
//if(strtolower($userfile_type) != "application/octet-stream" || strtolower($file_ext) != "pem"){


<<NEW>>

if(strtolower($userfile_type) != "application/x-x509-ca-cert" || strtolower($file_ext) != "pem"){


If you want to see how the old code was broken; I inserted this line to get visible output in the control panel that showed what the variables were set to. It was then apparent where the mismatch was:

$strMessage = "<br/>file_ext is: " . $file_ext . " filename is: " . $filename . " userfile_type is: " . $userfile_type;

-Tim
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/14/14 10:26 PM (7 years ago)
FYI, this is now fixed on buzztouch.com
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.