Image Uploading But its Different from All other in Angular - angular6

image is not showing in my application after uploading but it showing if i made any changes in angular application.
Error in console
but there is file in respective location but it didn't show until any change in angular application

Basically in angular you can load dynamic image by this way.
<img [src]="yourImagePath" />
Path should be like this.
assets/posts/image.png
First try to print image name in for loop and check path is correct or not.
Second thing I suggest you to use ng-template feature of angular. This is the one of the most powerful feature of angular. This is mostly used to show Or load dynamic content in web page.
Note: Make sure that space should not exist in image path.
If sill you are not able to load or access your image then you can try this also.
1) You should try to load image from angular's app path instead if assets path.
[src]="app/path/assets/posts/image.png" // Make path as per your structure.
2) Another option :
[src]="./assets/posts/image.png">
Update
The thing is, when you are running ng serve that triggered in memory webpack dev server - not a thing you want to run on your server, that is for dev only. This way, until you restarted ng serve, you wont get any changes happend in your assets folder as it is default folder for your static assets configured in .angular-cli.json.
So when you access assets folder dynamic, It's not possible you have to restart the app.
Solution :
I suggest you to use another location to access your dynamic images.
For an instance: You can upload a new images at...
public/images

Related

How can I find the file containing the code selecting the pin for a Google map in Wordpress?

I'm displaying a Google map in my Wordpress site using the Qode Tours plugin, and I want to change the pin to a custom one. There is no option within the plugin to change the pin of the map, so I want to find the file to edit this. I can see the piece of code selecting the pin:
I downloaded via FTP the whole plugin folder and scanned it via bash (on Mac) looking for the string data-pin:
egrep --color -R 'data-pin' *
but it's not there. I found a location.php file with a string 'custom_map_style' => 'yes',. Is there a way to find out where it's taking parameters from?
if you own the server that image is hosted on... go find the image in the server using the path you have highlighted, and change it via FTP or SSH/RSYNC
so go into this folder on your server
/wp-content/themes/bridge/img/
download the image pin.png so you know the dimensions it is expecting, then change the image to whatever you want it to be, then reupload it with the same name, essentially overridding it. Now when your plugin references that pin, it will use your new image.
*NOTE - once you do this, the original image will be lost forever, so you may want to dupe it and rename it to something like pin_legacyOriginal
**NOTE - make sure to clear your browser cache when checking for the new image.

404 (Not Found) Image file on web app

I am building a website and along the way I used imgur to store the image that i was using in it but I decided to created a folder in my app to store them.
Since I'm not using imgur anymore, i needed to change my path to find the image and that's where the problem appeared, I can't find the image.
The structure looks like that:
webapp_folder
|_node_modules
|_image_folder
|_public_folder
|_views
|_partials_folder
|_main.js
|_app.js
|_package.json
In main.js, I use one of the image in image_folder and the path to the image looks like: src="../image_folder/image.png" but that's where I got the 404 error.
I've tried putting the image in the same folder that the main.js so the path would look like src="image.png" but still getting this error.
So i guess it's not a path's problem but I've no idea what it could be.
Hope I could make it clear!
I'm using node.js and express.
You need to make routes to the assets.
app.use(express.static('image_folder')
Whenever you are using an asset there are multiple ways to include that in your project.
In your case, whenever an image is loaded it is actually loaded by the browser using network calls from client side. Not server side. So client side code doesn't have access to internal paths (for ex: /usr/local/ kinda paths). Whenever they fetch something it is relative to the host, maybe in your case localhost so, fetching /image.png is fetching localhost/image.png but your app doesn't have route to those image files. So, we make routes for all the assets which is done by express.static
Another way is you can actually require the image. So, bundlers (with proper config) make some public folder and put the assets to that folder. react/vue apps by default do this.

If an Angular 2 project is hosted and running on a server, can we download just HTML and make the changes and view them?

In other words.. if i make changes to just the HTML without pulling down the whole project, will that change be reflected? Is that possible?
I would like to know if it is possible to do that without having to follow the normal process ...
make appropriate HTML change -> build project and upload dist folder onto the server ..?

Java EE Web App - Image path configuration

I have implemented image upload feature but I am facing issue with its path configuration.
I want to store the uploaded the images outside of webapp root directory because every time I un-deploy the application, it deletes the images within the application.
Now, I can store the the uploaded file by getting the path from property file [say C:\images] but when I use that path in it doesn't show the file in web page.
Can you please let me know how to get the absolute path in img src tag.
For security reasons, you can't reference files outside of the webapp root. You're going to need to use virtual directories. These will map outside paths into accessible URLs so c:\images will be accessible as myapp.com/myapp/images/
This sort of thing is specific to the application server you are running, so you'll need to check the documentation for your system to make this work.

ImageLoading relative path problem in Flash

I'm trying to load images from a relative folder /media/one.jpg but it never loads, I use the same script to load from my local folder and it does.
The absolute path e.g c:/mydir/one.jpg does not work either. Earlier I used to throw things at my server and get jpegs from there. But for testing purposes I need these images locally available.
Any Idea?
Just solved it Use loadImage("media\ears.jpg"); double slash instead to single and it works :)
For security reasons flash files can access only web or only local files, with can be set in the project properties. If you want to build a web application like a webpage or just a part of a webpage, than you should choose network only, but this way you can test your work only on a webserver (that can be localhost too ). If you want to build a desktop application, witch has no relation to web, then select the "local only" option in your project properties.