Downloading file in Android browser data transfer failed - php

We've been searching for the cause of this issue for a few days now so maybe somebody has some insight.
We're using php to force a download of files (in this case mp3) from the server into PC browsers and Android devices. The code works fine on PC. On ALL Android devices we've tested, the GET request will trigger the download manager to attempt to get the file, but Android won't respect the attached filename, instead showing the name of the script, and the file download will ultimately fail with the following message:
Download Failed - Data connection failed
Attempting to download the file from a test site running on my computer with the EXACT same code works correctly.
I created a brand new server yesterday with the exact same operating system (CentOS) and version of PHP (5.5.16), dropped my php script onto that box and attempted again from my Android device and it WORKED perfectly. Again, EXACT same php code.
All signs are pointing to the answer being a server (mis)configuration problem. I didn't set up this server, nor do I have root access, so my testing options have been limited to trying to get my sandbox servers to "break" and start reproducing the same behavior.
I'd include PHP code, but I have 2 separate environments where the code works fine. If I run dev tools in my desktop browser against the working and non-working environments and compare responses, they are identical from what I can tell. The headers are identical and the payload is the exact same size. Something is causing Android to not like the response from one server, and like the response from the other.
Some insight, or at least a place to start would be helpful. The only two things that are different between my environments are:
Working sandbox environment is responding with HTTP 1.0 and the SSL
cert is from Rapid SSL. The sandbox environment will work with or without SSL turned on.
Non-working staging/production environments are responding with HTTP
1.1 and the SSL cert is a wildcard cert from COMODO.
I wish I could be more helpful but I've exhausted the usual, obvious questions that responders would ask on here. If you need more info, or want to see phpinfo dumps, I can provide.
Thanks in advance for any assistance.
EDIT - The Android request are showing in the access logs and there are no errors. From a server log perspective, everything looks perfect.

Related

Http request refused on Windows environment but not on OSX (mac)

I am working on a React web app with npm for the first time. I'm done with the development and now putting the built package on the web server (bluehost).
All is working well on my Mac: the web app allows getting data from mySQL via php, and posting back to the database.
But when I try the same app (on the same URL, same server, script, same everything...) on my Windows machine, I get an error on the first http request used for authentication.
OPTION http://example.com/script.php net::ERR_CONNECTION_REFUSED
First I thought this was a browser issue.
But I don't get the error on Chrome on my mac but do on Chrome on my Windows, as well as FireFox.
Again, I do not get this error when I test the app on my mac.
Could anybody please give me some direction to solve this?
Thank you!

Restful php client not working on server but works fine in localhost

i need build a restful client on php. i have used pest class which is available on github. my client is working fine on localhost where the web service is hosted on a remote server. but when i uploaded the code to another server it returns timeout. I havent used any extension php (dll files). what can be the issue. please help me. thanx.
How does it execute it's web requests? (Sockets, file_get_contents, curl?) I'd imagine it's an issue of not allowing outbound requests. In that case, contact the server admin and ask them. Try using a demo curl script to see if you can contact google and pull down its index page, that will tell you if you are allowed out bound requests. I had this issue before, where my server was denied outbound requests and just had no results. I would think the server-admin would be able to help here.

APNS issues with windows server Push Notification iOS

I'm having issues when uploading and running my php script to a windows web server.
The php (with accompanying certificate and key) works on my local machine, but not when I upload and run the script from the web server.
Is this a certificate issue? I've followed many different tutorials, but am obviously missing some fundamental piece.
The tutorial I used to get the push working on my Mac's local MAMP server is: http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
I've also found the following thread which seems to have solved the issue, but I can seem to get it working myself :( ... "This took me forever to figure out but I finally pieced it all together from the minor clues people left." http://arashnorouzi.wordpress.com/2011/06/19/sending-apple-push-notifications-in-asp-net-and-c-–-part-4-apns-sharp-c-wrapper-class/
You need to download the certificate for the APPID that you register on the developer portal. That certificate must be converted into a P12 format to be used on Windows.
If you are running Yosemite, the easiest way to do this is to import the certificate to your keychain, then export it to a .p12 file.

Trying to use post to a virtual machine server that runs a codeigniter project

I am running a virtual machine on my computer (debian 6.0.2.1) that runs an apache+php+mysql server. On my local machine I have a WAMP stack instaled. On both machines I have CodeIgniter deployed and running a RESTful API.
What I am trying to do is to communicate with my virtual machine from the local machine's application. The virtual machine's application accepts post & get methods for an end-point.
e.g. http:///thumbs/save/ it should return a message. If I test it in the browser for the get method, it runs fine. The problem is when I try to access it from the other application (local machine deploy) with a jquery post/get I get the following:
for chrome as usual: XMLHttpRequest cannot load http:///api/thumbs/save. Origin "http://localhost" is not allowed by Access-Control-Allow-Origin.
and firefox just throws a 200 with status OK but it shows up red and with no response.
A little help would be appreciated. Tell me if you need code examples.
Thanks.
The reason you are seeing that error, Access-Control-Allow-Origin, is to prevent a security issue known as XSS (Cross Site Scripting). Your one domain is localhost, and the other is API.
Take a look at this question/answer for some ways around it. No code examples, so not sure what methods/access types you are using: Access-Control-Allow-Origin error sending a jQuery Post to Google API's

Bizarre timeout in Web CMS, ideas?

I know this kind of thing cannot be adequately answered without a link to the live example. Unfortunately, I can't set one up right now as it's a back-end login and creating a safe public login would be too much to do at this point. Sorry. I'm hoping for ideas and input from people who may have experienced something similar in the past.
I am setting up a CMS for a client with a DSL connection in Spain.
The CMS is hosted on a straightforward standard, LAMP based, shared hosting package in a network center in Germany.
It comes with a .com domain.
When my client tries to log in to the CMS using Internet Explorer 7, everything works fine.
When she tries to log in using Firefox, she gets to the login form, submits it - and then the connection times out.
When she logs in using Firefox but using "domain.com" instead of "www.domain.com", everything works fine.
This happens on all computers that are hooked up to that line. One Windows XP, one Windows Vista.
The front-end part of the site, as well as a second, older CMS, work fine in all browsers.
I do not have access to the raw access logs.
I have not been able to reproduce this behaviour on any other connection.
Debugging ideas are welcome. Remote diagnosis is extremely difficult as the line is too slow to set up a proper remote connection.
If you are limited by how you can troubleshoot this, have the client install Fiddler - Web debugging proxy and then run the trace, and send you the logs, Fiddler will analyze the traffic (be it proxy or DNS timeout, etc)
Take a look if you have not used it before:
http://www.fiddler2.com/Fiddler2/version.asp
Check that Firefox and IE are using the same proxy settings.
DNS issues? can you put here your A records to check is everything is ok?

Categories