I'm developing web app for my customer. He uploaded image with name 'Şahan.png'
On my test server I can see image properly.
<img src="https://example.com/Şahan.png">
But on my production environment which is hosting on azure, image looks like broken.
Print F12, check img tag. After test, in linux or windows, it all works fine on azure.
Please try to open your kudu site, and check your Şahan.png file.
Related
So i want to save an image from windows to my linux folder im using LAMP i create a php for save images into a folder on windows works perfectly but when i upload the file to linux, and i tested dont work this is the php im using the redbean framework.
The server I did it with lamp and I use google chrome to access it when I select the image to insert it saves the route but it does not save the image in the folder of the server that is in linux
Other thing i open the server via google chrome and it's work the php save the text the img url but dont save the image into the linux folder.
CODE:
<?php
require('conexion.php');
$b=R::dispense('blog');
$fileName=$_FILES['imagen']['name'];
$file=$_FILES['imagen']['tmp_name'];
if (is_uploaded_file($file))
{
echo $fileName;
$destino="/var/www/html/blog/imgsubidas/".$fileName;
move_uploaded_file($file,$destino);
$b->titulo=$_POST["titulo"];
$b->imagen=$destino;
$b->contenido=$_POST["content"];
$b->fecha=date("d/m/Y");
R::store($b);
header('location:dashboard.php');
}
?>
I have a website hosted in LAMP Server.
My Lamp server is installed in a Debian virtual machine.
My virtual machine is hosted in a distant server.
I face a problem when i try to display an image in my website from the distant server. this is an example of the code i am using :
src="\\NameOfDistantServer\Directory\MyImage.jpg"
When i try this code, nothing is displyed.
I need your help.
Thank you
I'm pretty sure it should be something like:
src="http://NameOfDistantServer/Directory/MyImage.jpg"
You need to specify the http, otherwise the browser thinks the file is on the same server as the html page. You need the / slashes because that's what most web servers understand.
If I really understand your question, you have a linux webserver and you want to embed an image from your server inside a HTML file.
When you wrote src="\NameOfDistantServer\Directory\MyImage.jpg", you should add slashes instead of backslashes even if most browsers changes them correctly.
Asyour question is a bit unclear, I will show you most used methods of embedding images on a webpage.
1. Specify full URL of the image:
If you want to specify full url, your code should be like this:
<img src="http://yourdomainname.something/directory/yourimage.jpg"/>
2. Specify a relative URL of the image:
If your image is hosted for example, at: http://example.com/directory/test.png, and you want to print that image still on the same domain (example.com), you can specify the relative path of the image, not the entire path:
<img src="/directory/test.png"/>
3. Encode images to base64 to not use files
If you don't want to host the image inside a file on your server, you can covert it to base64 and embed it on your webpage as a code, instead of file url. For this, you can use our service which is converting the image you choose to an encoded image: http://netcreator.us/base64-image-encode
The only way i found to resolve my problem was to do mount command :
mout -t cifs /serverDistant/directoryToshare /directory username pwd
After this command i can display all the image like if it was on local directory.
Thank you all for your suggestions, i really appreciate your help.
I'm using Codesleeve/asset pipeline on my Laravel project to serve css, js and image files. It on the whole works fine but there is an issue with displaying css-loaded images. The image does not display and shows the browser's "broken image" symbol when loading it directly (http://art.ipscap.com/assets/select2.png for example): e.g.
Upon inspecting the page it shows the image is loaded successfully with 200 OK status (or cached) but there seems to be an error displaying it. Seeing as the image in question displays fine on my local machine and the problem is only in production is there a way to diagnose this issue?
Edit: Still haven' t managed to find a solution for this. For reference the live broken image url is https://art.ipscap.com/assets/select2.png. The image itself is in app/assets/images/select2.png and the readme in the same directory states:
If you place an image here called foobar.png then you can access that image by going to http://<hostname>/assets/foobar.png
I find it strange as the image does not fail to load but is being broken by asset pipeline. The same does not seem to occur to other images in the app such as the header jpeg image.
Do you use different server software on your local and production server? I see the production uses nginx. In that case, you might have to add something to your config as stated here:
https://github.com/CodeSleeve/asset-pipeline#can-i-use-nginx
I tried to use Google Doc Embedder by using this code
[gview file="http://localhost/wordpress/wp-content/uploads/2013/07/list.pdf"]
but this error keeps on showing up..
Sorry, we were unable to find the document at the original source. Verify that the document still exists.
You can also try to download the original document by clicking here.
I checked in the directory/path to verify and its still there. So what is the reason that this error keeps on showing up?
Google Docs doesn't have access to your local machine. It will need to be on publicly accessible web server for that to work.
Your file path is wrong. You are pointing to localhost for your server. This is something running on your machine only so google reader would not be able to point to a file on your machine.
You should upload your file to a public server.
You can try even
<iframe src="http://localhost:8080/pdf">
I think there are plugins for iframe in wordpress ,Try it out..
In my Wordpress I use this plugin for Google Docs to embed .pdf
DirtySuds - Embed PDF
Then in the post use this:
[embed width="620" height="600"]http://site.com/file.pdf[/embed]
edit:
You will need live host to upload your .pdf files there.
I've got a image upload script that works on my Apache on IIS development server, but on the Apache Lunix live server, although the images are uploaded correctly and the MySQL database is updated correctly, I can't view the images.
Viewing the HTML source, checking both the FTP files and the database values, all look OK.
But the image doesn't show, just the white box with the red cross in the corner.
If I try to copy the shortcut of the image and open it in a separate window, I get the following:
I'm not sure what to try next, it seems strange that the files/database/source look good but it just won't show!
I've tried both $HTTP_POST_FILES and $_FILES to upload the images, but both have the same result.
Change the File Permission for images you are uploading, You Apache Server doesn't have permissions to read the image file.
So usually people have Apache Server run as a particular user, which has read (may be write ) access to such content