I have a jsp page where in I upload an image(MultipartFile) and store the image name in database and the image file in a central repo.
Now when I want to edit the image (when the page loads) the image gets displayed as the src is the actual path from repo. However now if I just save it the fileName is empty.
Is there any way that I can get the fileName
Related
The new TinyMCE 4.3 Image Tools (eg when cropping) saves images as blob data instead of image files in a directory. the edited mage url is like
blob:http://www.example.com/f2953aa1-e64f-49e1-a6e3-a283986663bf
I want to upload the image file to a specific folder and then use it as regular image referance / path.
Note
The question I am going to put is similar to Image edit issue. but the answer to this question is not working. I also tried http://archive.tinymce.com/forum/viewtopic.php?id=35740 solution but not working because it produces always same name image name.
The basic process is that TinyMCE will create a separate HTTP POST for each image that you modify with the image editor. It will send that image to a URL of your choosing (via HTTP POST) based on the setting of the images_upload_url option in your init.
The image handler at the URL referenced in the images_upload_url (which you have to create) has to do whatever needs to be done to "store" the image in your application. That could mean something like:
Store the item in a folder on your web server
Store the item in a database
Store the item in an asset management system
...regardless of where you choose to store the image your image handler needs to return a single line of JSON telling TinyMCE the new location of the image. As referenced in the TinyMCE documentation this might look like:
{ location : '/uploaded/image/path/image.png' }
TinyMCE will then update the image's src attribute to the value you return. If you use the images_upload_base_path setting in the init that will be prepended to the returned location. The TinyMCE page has more details on all of this:
https://www.tinymce.com/docs/advanced/handle-async-image-uploads/
The net here is that TinyMCE knows when an embedded image exists in your content but it can't possibly know what to do with that image in the context of your application so that job (the "image handler") is something you must create.
I want to change image in my crystal report dynamically in my Asp.net Project. So I used Picture field and set the path in "Graphic Location".
It's working fine when I give the path of external image like this "F:\abc.jpg".
But I want to give the path of image which is inside my project let's say I have a folder in my project "Images" which contains all images. So I want to set path like this "Images/abc.jpg"
How can I do this ?
The following is my requirement:
I have an image file called "Test.jpg" in a path say c:\. I'll change that image every one minute, but with same path and same file name. I want that image to be loaded in crystal report (Business objects) and that image should refresh according to the image change.
How would I do this?
I have to display pdf file content from database to iframe of a page since I donot want to show any kind of url and file name. Even I do not want the pdf to be generated. I just want to show the pdf content on screen.
Please help me out for this.
if you do not want to generate the PDF where the content of the PDF will be stored? Will it be dumped in DB before?
You can output the PDF content by setting the content type as application/pdf. If the browser is capable of rendering, it will be displayed in browser itself or else it will be downloaded to their local machine.
I am trying to display an image from "C:\temp". Here's the code:
string root = "C:\temp\";
string[] files = Directory.GetFiles(root);
foreach (string f in files)
{
if (Path.GetFileName(f).Contains(user.WorkEmail))
{
img1.ImageUrl = root + Path.GetFileName(f);
}
}
If an image is not found, I get a thumbnail with a red "X" - fine, as expected.
If an image is found, I get a thumbnail but no image gets loaded/displayed. When I right click the thumbnail and go 'Properties' it shows the correct filename.
You need to make this image part of the web site in order to display it properly. You need to use a relative URL:
img1.ImageUrl = '/App_Data/foo.jpg';
The image file cannot be located anywhere, when it is part of the web site a separate request is made to the server to fetch the image which is served by IIS. If you want to use image files located in a folder outside of your site root you will need to write a generic handler which will read the image contents, stream it to the response with correct content-type and then point the ImageUrl to this handler.
looks like you're creating strings of the form "C:\temp\myfile.jpg", right?
That's not a valid URL. your address needs to be either relative to your website's root (e.g. /content/myfile.jpg) or else it needs to include the protocol (e.g. file://c:\temp\myfile.jpg for local files or http://mysite.com/content/myfile.jpg for web access)
i had that problem and solved it ...
you should give the image adres cut
e.g:
www.yoursite.com/folder/image.jpg
Your image source should be = "folder/image.jpd"
No need of root or website.