Internal server Error Using http UrlConnection - android

I was referred to this
link(Upload large file in Android without outofmemory error)
for send internal storage file to server After that i got error
internal server error code 500.In my previous app, it was working perfectly
Is this client side or my server side problem?
I am using file directory :-
File mydir = context.getDir("mydir",Context.MODE_PRIVATE);

This is a error which can be occur due to your mistake.I think you should also post your code with you question which would also help us to understand what you are doing and will easy to amplify your mistake. I am referring you to this link which explains more about server error (error code 500) here and check the timeout you are using in your code .

Related

Axios Network Error in React Native with Expo in Android

I'm trying to run an API call in React Native on Android with Expo using Axios, but I'm encountering a network error. I tried some solutions, but nothing seems to work. This is the error displayed in the console:
Network Error
at node_modules\\axios\\lib\\core\\AxiosError.js:3:0in \<global\>
at node_modules\\axios\\lib\\adapters\\xhr.js:138:8 in handleAbort
at node_modules\\event-target-shim\\dist\\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
at node_modules\\react-native\\Libraries\\Network\\XMLHttpRequest.js:647:10 in setReadyState
at node_modules\\react-native\\Libraries\\Network\\XMLHttpRequest.js:396:6 in didCompleteResponse
at node_modules\\react-native\\Libraries\\vendor\\emitter_EventEmitter.js:150:10 in EventEmitter#emit
at node_modules\\react-native\\Libraries\\BatchedBridge\\MessageQueue.js:417:4 in callFunction
at node_modules\\react-native\\Libraries\\BatchedBridge\\MessageQueue.js:114:6 in guard$argument_0
at node_modules\\react-native\\Libraries\\BatchedBridge\\MessageQueue.js:368:10 in guard
at node_modules\\react-native\\Libraries\\BatchedBridge\\MessageQueue.js:113:4 in callFunctionReturnFlushedQueue
I tried changing the localhost in the API link to my IP address, as well as to 10.0.2.2, but nothing worked. I checked my internet permission in AndroidManifest and made some other permission changes to the file, but nothing seemed to resolve it. I hope to find a solution to the problem soon.
if you are using a tool like expo go, [axiosError: Network error] is simply an error saying that the api you provided may not be reached.
so if you want to pull data from a local storage instead of cloud storage ... you may create a server like for example php artisan serve then create an Ngrok server for that server , afterwards take the link you received from the ngrok then use it as your new API endpoint
i m the same problem. you found solution l

I am getting an 403 error when I am trying to access an api through my app

I am a bit new to android development. I was using an api form newsapi.org and every time I am getting
a some thing like this while api callSee the last line in run log
Can any body help me with this, like is there might be a problem from my end or some thing else?...Thanks in advance
The 403 Forbidden error is an HTTP status code that means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason and you don't have permission to access [directory] on this server. I saw your attached image and I think maybe your api key is out dated.

java.io.IOException: unexpected end of stream on Connection over http://

I am creating a project in android studio. I am getting this error while retrieving information from a sql server database. I am using .php files for database connection. On debugging I found that the following line is generating the error :
inputStream = urlConnection.getInputStream();
On further inspection I have found that if I access my PHP files(which are used to query sql-server) over https:// then the project is running well........but whenever I am accessing my php files over http://, the IOException is raised.
The problem was caused by a space in query string of url. Browser and Postman seem to detect and automatically correct this error.
I also have this problem. got solved by using trim() function in variables used in URL.

android POST - Unexpected response code 403

I want to add user inputs to web server. I use PHP and MySQL to store data. The app POSTs data to http://url_address/getData.php .
On localhost while I POST to http://192.168.1.38/getData.php everything works OK and data being inserted to database.
I also used https://www.000webhost.com/ to test my code and the data is inserted to that server. I could see from phpmyadmin.
But when I change address to my web address http://mywebsite.com/getData.php I get an error
E/Volley: [208] BasicNetwork.performRequest: Unexpected response code 403 for http://... I use hosting from https://ifastnet.com/
I googled and found that I have to change my httpd.conf file as belov:
<Directory />
AllowOverride none
Require all granted
</Directory>
But I use shared hosting plan and I cannot change httpd.conf , insted I should use .htaccess file. But when I use .htaccess I get below error:
A 500 error has occured
500 errors are generally caused by one of the following two problems.
1) A bad entry in the site .htaccess file, if you are the webmaster
try logging into your cPanel, and use the file manager to rename your
.htaccess file if this fixes the error you should then check the
contents of the .htaccess file / roll back any recent changes.
2) A php error / code error also causes a 500 error, you can try
enabling 'PHP display_errors' by following this guide Enable Display
errors
If after trying both of the above solutions and you are still seeing
the 500 error please do contact support
help me to overcome this problem.

403 AuthFailureError in Volley

I am having a very strange situation. I have a running script that makes JsonObjectRequest using Volley Singletone. The script has been working perfectly in domain example1.com. Recently I bought example2.com and hosted in the same hosting account. And when I copy all the php files as it is in the second domain, I am getting error "BasicNetwork.performRequest: Unexpected response code 403".
So, I have exactly same php files called using JsonObjectRequest and Volley Singletone working in example1.com, but not in example2.com. I have check the permission of the files in both domain, they are exactly same (644) and there is no htaccess in either of the domain.
I am stuck and don't understand what else I should check?
Any help will be highly appreciated.
Problem is with your server side php script - You can first try to test POST requests using some tool before implementing in your Android application:
If I performed a simple POST request (just using browser not Android) to your provided link I get following error:
403: Forbidden
403 Forbidden Forbidden You
don't have permission to access /mylibman_4_5.php on this server.
Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request. Apache
Server at mylibrarymanager.com Port 80

Categories

Resources