Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing Remote Files

 
Rohit Koundinya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i am facing a problem in accessing Remote files.
My application has developed in java as well as in .net.
from .net side the users selects some images and stores in the particular location say Images folder.
now i want to access that image folder from our java. in jave i am using jsp and servlets.
i am using Tomcat as our web server and .net application is working on IIS server.
Both are in different locations.
i want to show the images selected by users in my web application dynamically when the user access my web application.
i am not able to find the format of the image. the image is either jpg or gif or png or bmp.
i am getting just image name from the MSSQL excluding the image format.
Please help me in this. How to solve this problem?

Thanks in advance,

==Rohitk==
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting just image name from the MSSQL excluding the image format.

are you sure that there isn't another column in your MSSQL table to store the image extension?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Insert image name with its extension. Otherwise you will end up writing code to figuring out the image extension/format.

Or I wonder if you can use wild card to search the image and after getting one get its extension. Obviously, assuming no duplicates. I have never done this. Not sure just an idea.
 
Rohit Koundinya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

we dont have any table fields with the image extensions.

Thanks,
==Rohitk==
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the .NET side determining the image type?
 
Rohit Koundinya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for answering my problems.
For the .net side people the folder is local to them.
They retrieving the image name from the DB and checking with the files which are in the folder.
They are taking that files in an array and iterating with the image name by giving the file extensions.
if anything is matching they are simply placing the image.
where as for us it is different machine.
i think my webserver should talk to IIS server.

Thanks,
==Rohitk==
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there is no way for you to keep the extensions, then you will probably need to examine the binary files to determine their type.

A Google search with keywords "Magic Numbers" should get you going in the right direction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic