I'm trying to build a Flask APP, which includes two webpages. The first one allows users to upload an image, after which the server will take the image input and make predictions from CNN and generate some image results. For the first page and from the server end, they both work well. The user upload and image generation are successful. However, the second page won't load the newly generated images. The page shows as bellow:
The second webpage
Two issues could be possibly related to this:
Permission issue? I set the permission of this app folder and subfolders to 777, although the uploaded images and newly generated images are not. Please see the below image for details of these image permissions.
ls -la for all images to be shown
Even The pink ones are either uploaded(the first one) or newly generated (the rest two), while green ones are "shutil" copied from another folder. As green images inherit the previous permissions, it should display, but why does it not?
BTW, I also tried the solution here, but it still doesn't work.
Am I on the right track to solve this? Thanks in advance for any help.
Yanyang
Have you inspected to validate that the image path its using as the src is correct? This would be your first step to validate the application is correct.
After that try validating any error logs that may indicate a local file error, this would depend on the web server software you're using.
Related
I have a bizarre issue with one of my Sitecore sites. Most (but not all) of the images in the Media Library are not displaying in Page Editor/CM. When I view my site in Page Editor or go to mysite.prod-cm.com, the images just show the broken image icon. If I try to go to the image directly, such as mysite.prod-cm.com/~/media/Upload/exampleImage.ashx it returns an error page. However, if I go to the same path on CD, mysite.com/~/media/Upload/exampleImage.ashx, the image displays. In Sitecore, in the master database, I see all my images, I am able to preview them and download them and there appears to be nothing wrong with the files.
I checked the logs to see if there were any useful clues about why the image paths are returning an error, and I see the following message
"WARN Protected page accessed with no current user".
Is this a security setting in Sitecore? This only started happening recently, is there a way to unprotect the Media Library? Like I said, some images still show up, but any new images I add appear broken. The only other message in my logs is
"WARN Memory usage exceeded the MemoryMonitor threshold".
To add on, I can view the images by the path with their item ID, such as mysite.prod-cm.com/~/media/C98B4DAC5FBD416CABF0070D087AE5E2.ashx. That works, but the path with the item name does not.
Am very new to magento, created one site using magento. All the functionality are working fine in localhost. When am upload that code into online(server), i got one issue. except that all functionality are working fine.
While am uploading an image i got the issue "Unable to create directory".
Images are uploading to tmp path but not moving to target path. Because when am press the button 'upload files', I can able to see the upload percentages. That is why am thing the files are not moving due to dynamic directory creation fails.
I have tried lot but i can't able to make it as work.
I had tried the following solution,
1. Changed the media file permission to 777.
2. Created one tmp directory under /var/ directory and assigned manually in as tmp directory by change the line 91 of lib/Zend/Cache/Backend/File.php ('cache_dir' => null to 'cache_dir' => 'var/tmp').
3. Changed the php.ini file under the magento root directory.
Newly added lines are,
magic_quotes_gpc = off
short_open_tag = on
extension=pdo.so
extension=pdo_mysql.so
4. Checked whether GD library installed or not. It was installed.
5. Changed scope attribute in Magento admin panel -> Catalog -> Attributes -> Manage attributes. After this you should find image, small_image & thumbnail attributes. Then am changed all these attributes scope to Global.
Many thanks in advance. Please share your thoughts. Feel free to post your comment also.
Finally I got solution at 22-Aug-2014.
Problem is PHP version issue, megento need php 5.2.13 but my server contains php 5.2.12
After updated php version, image upload working fine.
We are using Sitecore 6.5 and have a multi-site Sitecore solution (with lots of library code we have inherited)
Publishing the Media Library by item from Staging to Production but we are not seeing the image on the web.
The images are in the web database and the path to the images in the web site is good.
Error we are getting when the file is requested (same in browser window address bar) is http://domainname/error?aspxerrorpath=/~/media/OSS/Images/WaterAndWildlife/myimage.jpg.
There is no media prefix in the web.config
Any idea?
....Looking into it now but site is going live tomorrow so help very appreciated! Help!!
We faced a similar problem when, in production, media files were not published which resulted in 404 errors.
Solution: The problem was that media files were not saved to the database because a file path was provided with the Sitecore media files while uploading.
So the images were saved on the file system instead of in the database. But based on our web.config configuration we were fetching images from the database.
If you are facing a similar issue, just download the media image, remove the file path, and save it. Then re-upload the same image, save and publish the image.
Hope your problem will be solved.
One question, are these staging and production environments separate code files? if they are, what is the setting in your web.config for the settigns UploadAsFiles? because if that's true it will store them on server and the images will be on staging but not on prod. But usually if this setting is true and the files are getting stored in file system, specially in CM/CD environment it should push the physical files on publish as well, but sometime there might be other issues going on like permission etc..... and the files cant get to the destination.
"<setting name="Media.UploadAsFiles" value="false">"
I am doing a website(Joomla) and I am using admiror gallery. Everything is working fine while I was working in the localhost but now that I migrated it to a live server, I am having problems in uploading images in the gallery.
The first is when I create a new folder to contain my new images. When I create it and try to upload a zip file, it's taking forever to load only to find out that it's not even uploading at all. When I looked into it, the reason is when a new folder is created, the permission is 755 by default, thus, making changes on the folder is not allowed. I need to change the file permission to 777 and now I am able to upload my images but there is another problem that occurs. The thumbnails in the backend are showing broken images. This is because the 'thumbs' directory in home/administrator/components/com_admirorgallery/assets/thumbs/ is again set to 755. I tried to change it to 777 and reupload the images again. The images gets uploaded but the problem with the thumbnails is still there. I checked again the folder and the permission is reverted back to 755.
Is there something I can do with this? Any suggestion is appreciated. Thanks in advance.
You should check the files and folder owner, not only permission.
PHP user (Joomla) is the creator of thumb folder, thus it should be able to create files in that directory. Also, it is not safe to have 777 on live site.
Shambhala made a suggestion that should help. Also you should use AkeebaBackup when migrating from local to live server, I never had problems with it.
I managed to deploy cherokee as a reverse proxy for a django app running with cherrypy as information source.
All of the static files and media files seem to be served correctly except for a particular image.
On http://mydomain.com/media/files/none.png, I get a
The image "http://mydomain.com/media/files/none.png" cannot be displayed because it contains errors.
But if I append a ? behind that file's url, it shows up correctly as a 1x1 pixel image.
http://mydomain.com/media/files/none.png?
will give
none.png (PNG Image, 1 x 1 pixels)
which is expected and correct.
Why is this so?
Browser cache problem. Issue solved a while back. Closing this.