wordpress unable to upload image, however some images get uploaded - wordpress

I am unable to upload image in wordpress but sometime image gets uploaded.
I checked whether it is issue with image size more surprisingly sometimes i am able to upload higher size image and sometime not.
While uploading, in browser developer console it shows
Request URL: http://srintimates.com/wp-admin/async-upload.php
Request Method: POST
Status Code: 404 Not Found
Remote Address: 107.180.44.152:80
Referrer Policy: strict-origin-when-cross-origin```
However the file http://srintimates.com/wp-admin/async-upload.php is there in server.

Check your server is are space to upload ?
And what is the message you see in front wp-admin
Your question is unclear

Related

Image URI error in loading from firebase, no host specified in URI

I created a user account and added user's name and profile pic on sign up.
The on the profile page I am fetcing the result, I am getting email and name but image is not being displayed.
I get the following error.
The following ArgumentError was thrown resolving an image codec:
Invalid argument(s): No host specified in URI
file:///data/user/0/com.example.project/cache/image_picker6223730245122398943.jpg
How can I reslove this error. I tried adding http in the start of url but it did not work.
Look at the error message, the faulty URL is:
file:///data/user/0/com.example.project/cache/image_picker6223730245122398943.jpg
As Frank explained why it won't work, you also need to know what is causing this problem. You are storing the path for the image as it is on the device of the user who took the image. For example user/documents/images/image.jpg.
If you send this link to anybody online, it won't open. You need to take this file, and upload to a storage provider, for example firebase storage, get the download link for that file, and this is the link you want to store in your Firestore database.

Cannot get image and other mega for facebook open graph

Please check the link:
http://kotinos.com.gr/index.php/en/2016-09-20-12-44-31/rings/ring-012498-detail
and if someone can tell me why on earth i get debug errors for not having type or image as meta, i will be grateful.
The issue is that i don't get Title, description or image at all and as you can see from page source i have it all (they are produced through php and added as meta values)
Debug errors from https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fkotinos.com.gr%2Findex.php%2Fen%2F2016-09-20-12-44-31%2Frings%2Fring-012498-detail is based on the URL before 303 HTTP Redirect, and the page source you view is from the URL after 303 HTTP Redirect.

Image Upload - Local host interrupt

I have implemented a small method
for my site where I upload an image. using a FileUpload control, I choose an image, and then when I hit a button, the UploadImage() method is generated.
The UploadImage() method stores the image in a folder in the server and stores its path in the Database. It also checks the file size of the image, if greater than a megabyte, an alert is displayed, else, the image is upload and stored. This has been tested with a few images ranging from 45KB to 900KB. It has worked perfectly.
THE PROBLEM:
When tested with a few images of approximately 4MB, sometimes it shows the 'error' since it is greater than 1MB, but at other times (I do not know why), Google Chrome directs me to a page telling me that the localhost has been interrupted.
When debugging, I do not even enter the button Upload click method! I find this very strange. The extension of the image doesn't seem to be the problem since I am testing with .jpg and .png.
Did some one experience the same problem? Is there a guru that can help me?
Thank you very much.
update:
it seems that files of 4052kb have worked correctly (i.e. an error message was displayed)
but files over 4098kb) resulted in a local host interrupt. When the button is clicked,
the browser below shows 'sending request' and uploading (0%) and displays "The connection to localhost was interrupted."
Please take a look at the maxRequestLength of the httpRuntime element of the web.config.
http://msdn.microsoft.com/en-us/library/e1f13641.aspx
This is where you set the maximum request length. When it is exceeded, the runtime throws an exception. The default size is 4096KB.

How do servers behave when browsers request embedded resources that do not exist?

Let's take the following hypothetical situation:
an HTTP server has a custom error page set up /404.html and does a server-side forward for any URL that gives a 404 response (for example /blabla.html) to the 404.html page
a browser requests an existing page from the server, say /home.html
the page contains <img src="a.jpg" alt="a" />, but that resource does not exist on the server
the browser receives a 404 for the resource, marks it as missing and does not receive any response (tested this in Chrome and FF in the network tab of the dev console - the response bit is empty)
My question is: what happens on the server when the image is requested?
My guess is the browser cuts off the connection when it gets the 404 status in the header so it doesn't wait or download the response. My other guess is that it's implementation specific, but I'm curious if the servers notice that the connection has been cut off.
The browser will get your error page but he can't handle html in an image. (It will throw an error in the console)
If you would do it with a frame it will show your error page.

What does "pending" mean for request in Chrome Developer Window?

What does "Pending" mean under the status column in the "Network" tab of Google Chrome Developer window?
This happens when my page script issues a GET request whose response contains content-headers for downloading a CSV file:
Content-type: text/csv;
Content-Disposition: attachment; filename=myfile.csv
This works fine in FF and IE7, downloading a CSV file as expected and opening a file picker to save the file, but Chrome does nothing. I confirmed that the server responds to the request, so it appears that Chrome will not process the response.
Curiously, all works as expected if I type the URL into Chromes address bar and hit <enter>.
FYI: Chrome 10.0.648.204 on Windows XP
In my case, I found that the "pending" status was caused by the AdBlock extension. The image that I couldn't get to load had the word "ad" in the URL, so AdBlock kept it from loading.
Disabling AdBlock fixes this issue.
Renaming the file so that it doesn't contain "ad" in the URL also fixes it, and is obviously a better solution. Unless it's an advertisement, in which case you should leave it like that.
I also get this when using the HTTPS everywhere plugin.
This plugin has a list of sites that also have https instead of http. So I assume before the actual request is made it is already being cancelled somehow.
So for example when I go to http://stackexchange.com, in Developer I first see a request with status (terminated). This request has some headers, but only the GET, User-Agent, and Accept. No response as well.
Then there is request to https://stackexchange.com with full headers etc.
So I assume it is used for requests that aren't sent.
I had some problems with pending request for mp3 files.
I had a list of mp3 files and one player to play them. If I picked a file that had already been downloaded, Chrome would block the request and show "pending request" in the network tab of the developer tools.
All versions of Chrome seem to be affected.
Here is a solution I found:
player[0].setAttribute('src','video.webm?dummy=' + Date.now());
You just add a dummy query string to the end of each url. This forces Chrome to download the file again.
Another example with popcorn player (using jquery) :
url = $(this).find('.url_song').attr('url');
pop = Popcorn.smart( "#player_", url + '?i=' + Date.now());
This works for me. In fact, the resource is not stored in the cache system. This should also work in the same way for .csv files.
I had the same issue on OSX Mavericks, it turned out that Sophos anti-virus was blocking certain requests, once I uninstalled it the issue went away.
If you think that it might be caused by an extension one easy way to try and test this is to open chrome with the '--disable-extensions flag to see if it fixes the problem. If that doesn't fix it consider looking beyond the browser to see if any other application might be causing the problem, specifically security apps which can affect requests.
I had a similar issue with application/json ajax calls. In ff/IE they were fine. In chrome in the Developer Network window Status was always (pending) because a different status code was being returned.
In my case I changed my Json response to send a HttpStatusCode of 200 then Chrome was fine and the Status Text changed to 200 OK.
For example using ASP.NET Web Api
return new HttpResponseMessage(HttpStatusCode.OK ) {
Content = request.Content
};
The Network pending state on time, means your request is in progressing state. As soon as it responds the time will be updated with total elapsed time.
This picture shows the network call is in processing state(Pending)
This picture shows the time taken in processing by network call.
The fix, for me, was to add the following to the top of the php file which was being requested.
header("Cache-Control: no-cache,no-store");
Same problem with Chrome : I had in my html page the following code :
<body>
...
<script src="http://myserver/lib/load.js"></script>
...
</body>
But the load.js was always in status pending when looking in the Network pannel.
I found a workaround using asynchronous load of load.js:
<body>
...
<script>
setTimeout(function(){
var head, script;
head = document.getElementsByTagName("head")[0];
script = document.createElement("script");
script.src = "http://myserver/lib/load.js";
head.appendChild(script);
}, 1);
</script>
...
</body>
Now its working fine.
Encountered a similar issue recently.
My App is in angular 11 and we have a form with some validators which have regex to validate the data. One of data element had a special character which the regex wasn't handling and it made the entire browser hung up. Infact, even though all network calls were successful with 200 Ok, chrome was not showing any response returned by the backend and was also showing the requests in Pending State when infact all network calls are successful, there was no console log errors or anything. Handling the regex fixed the issue.
After i found the issue, i googled more about it. Here is more explanation about it.
https://javascript.info/regexp-catastrophic-backtracking
I came across this issue when I was debugging a local web application. The issue turned out to be AVG Antivirus and Firewall restrictions. I had to allow an exception through the firewall to get rid of the "Pending" status.
In my case, a simple restart to my browser (chrome) and it worked straight away afterwards like magic!
Little bit of context, I happen to refresh my frontend web page and straight away went onto making a changes to my API which led it to restart. During that instance, the frontend was making calls to API which led into "pending" due to that API is reloading. Browser at this point cached that pending state. For me to get out of it is either I set no-cache (which I didn't want to) or simply restart the browser, I chose the restart.
A little background
I encountered such an issue when requesting an url in my Django project. The server is setup using Apache HTTP web server and basic auth for user authentication.
The url I was accessing required no authentication to access i.e. in my Apache config, I had set Require all granted on the url using the LocationMatch directive.
The issue
The url I was trying to access returned 200 status (in the Network tab in Chrome), but the static assets being used for styling of the requested webpage (css, javascript, font files etc.) associated with the request url were not loading and returned pending status.
In the meanwhile, the page loaded partially and still kept on loading. All this was happening in the presence of basic-auth dialog in browser, even though my url was granted all access.
What worked for me
Interestingly, as I entered my credentials and logged in, the requested page loaded all the static assets. This made it very clear to me that the static assets directory might NOT have the necessary access permissions.
Then, I granted the access to the static assets directory by updating my Apache config and then the requested url and the webpage loaded up fine (200 status) without any basic auth dialog OR pending status.
In my case, there's an update for Chrome that makes it won't load before you restart the browser. Cheers
I encountered the same problem when I request certain images from page. I use JavaScript to set the src attribute of an img object and if the network is poor pending will be displayed in the network panel of chrome developer window. I think it's due to the poor network.

Resources