Linking to images in dynamic webpages - java

This is a little tricky to explain but I will try.
We have a employee web directory at work that displays the employee photo and their phone extension number etc. Its a dynamic page written in javascript each page has the same layout but obiously the link to the image is always different.
Now what I wanted to do for some fun was to grab those images to use in our continuous build server (this is something people have requested believe it or not), so that when someone breaks the build I can embed their picture in the broken build email. I can generate the web page link to the persons details page but dont know how to grab the image link from that (there is no obvious naming convention) - I dont have access to the network share where the images are stored but do have permission to embed a link to the in the mail if I can figure it out.
Im flexible with the languages I can use I am just curious how to do this task

The web directory must be making an HTTP request for the image at some point. If you can find out what the details of that request are, then you can make an identical request to fetch the image. The "Web Scraping Proxy" logs HTTP request/responses in the form of Perl code. Set it up, navigate through the web directory to the image, and look in the proxy's log.

Related

Get image url(source) from the Site

Today I want to know how to get image URL from webSite,
I already read some questions and answers but they're not quite perfect for me.
The problem is, when I enter the site, there are some images. It's pretty easy that I get image URl by UI, But, it's really hard that I get image URL by Java Servlet and jsp. Sometimes, some image url is in only networks!
For example, http://map.daum.net/ <-- this site.
Enter the site, and see 'RoadView'. When you see Codes in Chrome(F12), there are no image sources in jsp codes. Only you can see in Networks!
How can I get image URL(source)? Is it possible?
ps. I can get image source using mouse and right click, but I want to get image source using java automatically :), so please do not write user's perspective.
ps2. I'm not very well using English, so there are so many mistakes and something like rude. I apologize for that.
So, what you want to do is to scrape a dynamic content of the page to extract some dynamically loaded data (an image url) from it. You did not tell us what programming language or environment you want to use. However, similar questions have been asked before, for instance this one: How to scrape ajax loaded content with jsoup. There are two frameworks named in the answers to this question: PhantomJS and CasperJS. Both are JavaScript frameworks.

com.google.gwt.user.client.ui.FileUpload how to set text?

I want to use this class com.google.gwt.user.client.ui.FileUpload for file uploading but I faced with the next issue. I cannot find how to set text programmatically. I mean in TextBox I have setText method to do it. How can I do it in FileUpload?
You cannot set,Since GWT file upload wraps with html input type="file".So there is no way to set set filename or path (text) to that.
That should be select by user only,for sure.
You can only get from it.
If you are talking about setting some name to your control like "select file",take a lable and add.
http://en.wikipedia.org/wiki/JavaScript#Security
JavaScript and the DOM provide the potential for malicious authors to deliver scripts to run on a client computer via the web. Browser authors contain this risk using two restrictions. First, scripts run in a sandbox in which they can only perform web-related actions, not general-purpose programming tasks like creating files. Second, scripts are constrained by the same origin policy: scripts from one web site do not have access to information such as usernames, passwords, or cookies sent to another site

access website within android code and retrieve a generated image

This description was very hard to word. Basically I want to know if it is possible to access a website inside Android coding without actually sending the user to that website.
What I want to do is use a free website that generates a random pic after you upload your picture to it. I want the user to be able to upload their selected image to the website, and I guess somehow in code make that website generate an edited image and retrieve it back into the application for further use.
I know this sounds really ridiculous but I just wanted to know if this was at all possible before I try writing the code. Thanks!
The first thing you need to do is do an HTTP post upload of your image, as outlined here:
Upload image
Then you can do your processing on the server side - you didn't specify which platform you are planning to use on the server side, but in PHP you might want to look at this:
HTTP POST file upload
Finally, you'll want to retrieve the resultant image you made available on the server side this way:
Retrieve image from an URL

Securing images used in java applets

I am using a java applet in my web project and some images are shown in this java applet.
I want to limit users to pull images from the web page. What are possible techniques for a client user to save images used in a java applet which is used in a browser session, except "print screen"?
Any ideas are welcome.
Thanks.
..What are possible techniques for a client user to save images used in a java applet
I don't know about typical end-users, but I'd do these things to circumvent several security strategies:
1. Hide them in the archives
Look at the source of the page
Discover the location of the Jars
Download each one by direct fetch
Rename them to .zip and expand them (quick & dirty), then..
Sell your images for causing me that much inconvenience to get them in the form I want.
That last part was sarcasm (mostly), but just wanted to make the point that if you put something in a Jar, people can get it out.
2. Hide them on the server
Use a packet sniffer to discover the image locations by URL.
Pull each image directly (etc.)
3. Encrypt the images
You might use techniques to encrypt the images, then obfuscate the code that decrypts them, but that would also fail against a determined hacker.
4. Screen grab
As mentioned already. 'Last resort' - crude, but effective.
..Any ideas are welcome.
Don't pursue such strategies. You won't achieve any form of security worth having, it will just irritate the user.
If the image is a bitmap inside of a jframe it'll be hard to capture it without resorting to a screen grab. Just like using it in flash the image file itself won't actually exist anywhere on the client.

BlazeDS/ FLEX - Upload an Image and Display

I'm working on a FLEX which enables the user navigate through a list of images at the server (BalzeDS tomcat 4.0.0.14931). The images stored under the "WebContent/Images", and the already available/ saved images are displayed as desired.
From this app user would be able to select a file from their local directory and upload it. I have done the necessary coding related with uploading the image and it successfully creates a copy at the desired folder at the server. Once the image file is uploaded I'm trying to display the it at the FLEX end, but the image is not displayed. When check at the target folder at the server end, the file has been created successfully.
In order to make the uploaded image visible, the BlazeDS Tomcat server has to be restarted. Since this is not desired way to go ahead, I am seeking some help from you experts out there to resolved this.
I tried searching the net get this issue sorted out, but unable to come cross any solution. An identical issue was posted on another forum (Tomcat restart problem), that also still not resolved.
I this is best approach to achieve this JAVA/ BlazeDS/ TomCat/ FLEX environment or is there a better alternative. The other alternative I could achieve this is through persisting the file into the database as byte[], but I did not want accomplish in that manner since size of the database tend to shoot up.
I would really appreciate if you could help me out on this.
Thanks in advance.
If you have to restart Tomcat, that means you are storing user data in your web-apps directory. You should not be storing any user data in the webapps folder. These are considered "system files" and should not be publicly editable under any circumstance.
Store any user data in a publicly accessible folder with the correct permissions and serve them over HTTP (you should be able to view it in a web browser).

Categories