How to Hide real path ??
Hi
Friends
Sorry for duplication post. because in previous thread i can't edit it
and code formatting is remains.
sorry for that.
see the following problem
====================
I have make File Upload Successfully using
dirName =servletContext.getRealPath("/uploads/");
File f = new File(dirName);
if(!f.exists()){f.mkdirs();}
out.println("<br>");
saveTo = new File(dirName+"\\"+fileName);Since it is uploaded successfully.
Now i navigate all uploaded files from perticular folder.
and want to download that file.
when i am using following code :
// LISTING FILES IN DIR
out.println("<br>");
File dir = new File(dirName);
String[] children = dir.list();
if (children == null)
// Either dir does not exist or is not a directory
else
%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="68%" id="AutoNumber1">
<tr>
<td width="50%" align="center"><font face="Verdana">File</font></td>
<td width="50%" align="center"><font face="Verdana">Action</font></td>
</tr>
<%
for (int i=0; i<children.length; i++)
// Get filename of file or directory
String filename = children;
//out.println(filename);
%>
<tr>
<td width="50%">
<p align="center"><font face="Verdana"><%=filename %></font></td>
<td width="50%">
<p align="center"><font face="Verdana"><a href="<%=saveTo %>">View</a></font></td>
</tr>
<%
out.println("<br>");
%>
it showing real path on link when i do mouseOver on it.
So i want to hide the real path and want to download that file.
since i am not using any database for this. it is just a prototype i m making.
Can u help me to hide the actual path and we can download that file
by clicking that perticular file.
Thanks in advance.
Hi, friend
Might u not still understand me yet.
actual problem is what i want to tell is :
following is my structure :
file1.pdf view
pic1.jpg view
pic3.jpg view
rom.pdf viewwhen i mouseOver on view of pic1.jpg it displayed the
link path in status bar : C:\name\JavaProg\webFUpload\build\web\uploads\pic1.jpg
but i want it should be : \webFUpload\build\web\uploads\pic1.jpg
and this is prototype only so i am not using any database.
just to display files from folder. ( that is /uploads)
2) second problem is :
when i mouseOver on other link like view of rom.pdf
it will display path of last uploaded file only that is
file1.pdf
and i m still unable to download it.
please give me proper way to download file in JSP.
Thanks
Similar Messages
-
How to 'Hide' real domain when using a personal domain name
Hello!
I'd be grateful if anyone has a solution for the following:
I use a personal '.co.uk' domain name for e-mailing, but my 'real' domain (from my ISP) shows up to the recipient when I send e-mails.
I remember from my days of using Windows that there was a way of hiding it in Outlook Express (in an article I read about personal domain use). Is there a way of hiding my 'real' domain in Mail?
Just to clarify how I'm set up with my personal domain: I bought it off 1&1 who then activated it for mail forwarding with, of course, my 'real' domain e-mail address as the destination.
Any advice would be gratefully received.Well, you set the From: address that will appear on the email in Preferences, Accounts, Account information. (You can even add multiple email addresses in the Email address line -- just separate them with commas. Then you can select which From: address to use.)
Anyone who looks at the complete message will still be able to see where it came from, but the From: field will be what you intend.
-fred -
Hi!
How can I hide url "http://127.0.0.1/htmldb/f?p=4550:11:10600805277182851681::NO:::" to something like:
"http://myhomepage.com"
but without showing application parameters when switching from one page to another?
THX!You just can do this if you've got an separate web server.
The index.html of your domain needs to be a frameset:
- Frame1 size 1 pixel
- Frame2 size 100% screen-width minus 1 pixel
On the second frame you can point to your localhost 127.0.0.1:8080/htmldb/.......:NO:.......
Whatever you're doing in that frame won't change your domain-name. -
How to hide the URL path on click of an link to URL element,from user
Hi All,
I have an link to URL element, on click of the link it opens the specified url in a new window. But in new window the user is able to see the entire URL path. I want to hide this path from the user. Can any one please suggest me how to do it.
Regards,
lakshmi.hi,
just check this help
http://help.sap.com/saphelp_nwce10/helpdata/en/f7/f289c67c759a41b570890c62a03519/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/7d/fdc99ab37a8d42892e0d39bbd23be8/frameset.htm
Link to URL Question -
How to get the real path of the xml file
I have a java application
following is the package structure
com>>gts>>xml
having file---------> MyXML.xml
com>>gts>>java
having java program to read the file
Problem is if I use File file = new File("..\\xml\\MyXML.xml");
java.io.FileNotFoundException: E:\LEARNING_WORK_SPACE\JavaXml\..\xml\MyXml.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
How do I get the real path of the xml file.
Edited by: shashiwagh on Jan 29, 2010 11:46 AMHi,
if your XML file is inside a package you can easily get it from the classloader.
Note that your application maybe packaged inside a jar so it is not safe to use java.io.File for this purpose.
You have an xml file in :
com/gts/xml/MyXML.xml
in a class of the same module (that will packaged in the same jar) for example com.gts.java.XmlLoader :
// To get the stream :
InputStream is = this.getClass().getResourceAsStream("/com/gts/xml/MyXML.xml");
// Or the URL :
URL xml = this.getClass().getResource("/com/gts/xml/MyXML.xml");Hope it helps. -
How do I get the real path!!!
I am trying to get the real path:
http://xxxxx/listusers.do?section=xxx
But when I am using request. getRequestURI() I get
listuser.jsp which is the value that listusers.do returns.
How do I get the real path?????hehe
You can't get the real path from a virtual
path..that's why you have virtual paths. -
How to get the real path of the application in a JavaBean?
Hi everyone,
I know this has been asked several times before, but I I am not really satisfied with the answers... :-)
I am writing a webapp which uses XML files for storing information, the "business" logic is in JavaBeans. So far I just used hardcoded paths, now I will have to put the thing on a server and need a better solution.
I understand I can use getServletContext().getRealpath() but that doesn't work in a Bean.
One solution would be to fill a (hidden) field calling that and passing the field to the Bean, but I don't really like that solution.
I am using Java Studio Creator 2 (Update 1), isn't there a way to access the ApplicationBean instance in my JavaBeans? As I understand it, I could get the path from there as well.
Thanks!When you create the bean that contains the business logic you will have to pass in the real path either as a constructor parameter or by setting a property of the bean.
-
How can I find the real path to servlet class
Hi,
I am facing an issue. Am in the process of creating a filter which would send a Last-modified along with the header. For this I will be checking the is-modified-since
header and lastModified date of the file.
The problem I am facing is that after taking the file part from the request and checking
the lastmodified date, it gives error. This is because i use,
String real_path = getServletContext().getRealPath(request.getServletPath());
and it would return the path to servlet-name and not to servlet-class, since servlet-name
is not physically present. It would return an error value.
Is there any way which I could find the real path to my servlet class file ?Remember you should not take the last mnodified date
of the class file or the jar file that contain the
class as the value for the getLastModified method
becouse the last modified date that should be used in
the caching is the last modified date of the dynamic
content that the servlet is about to prodice.
The same class file will produce different content
for different requests if not why do you use
servlets you can directly use the static contentThanks for a valuable remark.
Hence our getLastModified() often returns System.currentTimeMillis() result. -
How i hide a field of a custom view in OAF 11
Hi, im a new developer of OAF11.
What should I do, to customize the Purchase Order screen, if then the requirement is to hide the field that i insert from extended VO.
What I did was modify the XML of the page to add the field and then extended the original AM.
I added the extended view into the custom AM to prevent that fail with the field that i insert.
I must clarify that I modify the path of AM default for the path of the custom AM in the XML, then i upload the XML with the command import, and i see it the field in the page.
I tried to hide another field that i created by customizing the page, but I couldnt do. That´s why i insert directly the field in the XML original.
I Try to customize the driver involved with the page, but nothing happened.
First try it on the controller Father and after the son.
The page is in the POS module (iSupplier), and is POSVIEWPOG (PO Details).
The code that attempts to hide the field is:
OAApplicationModule am = paramOAPageContext.getApplicationModule(paramOAWebBean);
OAViewObject oaviewobject1 =(OAViewObject)am.findViewObject("PosViewHeadersVO");
if (oaviewobject1 != null)
OARow row = (OARow)oaviewobject1.getCurrentRow();
String vCustomType = (String)row.getAttribute("TypeName");
if (vCustomType.equals("Blanket Agreement"))
OAMessageStyledTextBean vHideField = (OAMessageStyledTextBean)paramOAWebBean.findChildRecursive("drbQuantity");
vHideField.setRendered(true);
else
OAMessageStyledTextBean vHideField = (OAMessageStyledTextBean)paramOAWebBean.findChildRecursive("drbQuantity");
vHideField.setRendered(true);
Can anyone help me?
If im grong other solution that i think is:
How I can put a field on a page with code and how to hide the field with conditions?, consider that the field is from the VO extended.
Thanks!!!Hi Yichao,
Chk these links
https://help.sap.com/saphelp_nw04/helpdata/en/5a/0c889a4d5911d2a5fb0000e82deaaa/content.htm
http://help.sap.com/saphelp_45b/helpdata/en/cf/21ec5d446011d189700000e8322d00/frameset.htm
thanks and regards
srikanth.p -
Button is generated at runtime how to hide it in WD4A
Hi Experts,
i am using SAles processing application thru Portal , there i have Customer search in the customer search iview i want to hide create sales order button.
i found the technical details by using personalization option
Technical Information for UI Element
General Information About the Application and Component
Application: POWL
Web Dynpro Component: SALV_WD_TABLE
Window Information: TABLE
View Information: VIEW_TABLE
Configuration ID: O200705080740527294200
Information on Field
Field ID: F_CREA
Type of UI Element: TOOLBAR_BUTTON
UI Element Library: STANDARD
Attributes of UI Element
List of Attributes
Attribute Name Value Context Path Type
COLLAPSIBLE
DESIGN standard (00)
EXPLANATION
TEXT Create Sales Order
IMAGE_FIRST X
IMAGE_SOURCE
TEXT_DIRECTION inherit (02)
ENABLED
TOOLTIP
VISIBLE visible (02)
ON_ACTION
VALUE_HELP_KIND
VALUE_HELP
what i found is Create sales order button is generated dynamic at runtime , how to hide dynamic generated button.Hi,
First you need to figure out where the button is being dynamically generated. Then you can use the enhancement framework to hide the button (Change the visibility of the button) once it is generated. The enhancement framework allows you to add code at certain positions within the application. You will have to find a point after the button is generated.
Hope this helps
Wenonah -
How to hide a drive in Windows 7, Service Pack 1
Could someone please tell me how to hide a partitioned drive (example my drive E:/) so that my kids cannot access it on their separate, non administrative account?
How to hide a partition in Windows?
Right-Click on My Computer [Computer in Windows Vista and Windows 7]
Click on Manage
From the list of options Click on Disk Management that will be located in the left-bottom section
All your hard disk and its partitions will be show in the right hand side
Right-Click on the partition that you want to hide and select "Change Drive Letters and Path"
Click on "Remove" and click "Yes"
Your drive will now be hidden in my computer
To unhide the drive :
Go to Disk Management Right-Click on the hidden partition [there will not be a drive letter on the hidden drive] again select "Change Drive Letters and Path"
Click on add and select an appropriate drive letter.
Click Ok
Now the drive is unhided.
Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
the thread. -
I created the mask successfully and I can get it to follow the face while hiding it... but as the person moves away, I'd like to change the mask to a smaller size to avoid covering more than the head.
Here's the video: http://tv.adobe.com/watch/no-stupid-questions-with-colin-smith/how-to-hide-a-face-in-after -effects/
Here's the question I left for Collin Smith:
Hi, your video was extremely clear and I followed along well. My one question is... what if the person moves closer and further away. When the person is close my mask is perfect, but as they move away it becomes too large and covers shoulders and back. Is there anyway to adjust the size of the mask like we do the position as he moves? Thanks again.AE Basics
Keyframe the mask path. -
Hide report path in oracle form 10g (10.1.2.0.2)
Dear all,
I m oracle form 10g (10.1.2.0.2) ,when i run report through form using paramform='yes' then parameter form open with path and userid/pass please
help me how to hide this pathDear all,
I m using WEB.SHOW_DOCUMENT, but i m running report without AS
using following code,
v_pw:=
get_application_property(password);
v_user:=
user;
v_conn:=
get_application_property(connect_string);
lv_host:=
:global.gv_ser_add;
lv_sys_param:=
'&server='||:global.gv_ser_nm||'&DESTYPE=CACHE&DESFORMAT=PDF&mode=DEFAULT&PARAMFORM=yes';
lv_path:='report=D:\test.rep';
lv_usr_dtls:='&USERID='||v_user||'/'||v_pw||'@'||v_conn;
lv_url:=lv_host||lv_path||lv_sys_param||lv_gen_param||lv_usr_dtls;
lv_url:=replace(lv_url,' ',lv_url);
hidden_action := hidden_action ||'&USERID='||get_application_property(username)||'/'||v_pw;
web.show_document(lv_url,'_blank');
please suggest where i m doing wrong
Thanks
Manoj rajput
hide report path in oracle form 10g (10.1.2.0.2) -
How to validate File Path given for upload
Hi All,
I am trying to upload a file using the File Upload Control. I have already bound the data and resource property with the context attributes. Can someone please suggest that what can be done to validate the file path? For eg. if i enter "abcd" in the file path and click a button for uploading the file. My application simply "<b>HANGS UP</b>" without even reaching the code what i have written on action of the button.
Is there any way to permit the user to enter the path only through Browse button and not manually? Please reply ASAP.
Thanks and Regards,
SmritiHi Smriti,
Have a look on the Following Links... which clearly briefs what is the use of FileUpload UI and how it works behind the screen...
<a href="/people/dagfinn.parnas/blog/2004/08/15/inputfile-how-to-hide-the-plain-browse-button you about the how the FileUplaod UI is being built.</a>
<a href="/people/dagfinn.parnas/blog/2004/08/15/inputfile-how-to-hide-the-plain-browse-button more stuff on FileUpload UI</a>
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;892442">How the FileUpload UI interacts with the local system</a>
After going thru above post, you can identify that the inputField is being declared as FILE type (like <input type="file" >), and you would also noticed the cause for your error in the last link which I have specified above, and what microsoft also recommends for it as a solution to show an alternative message in place of the blank screen...
Hope now you would be clear...why your method is not being invoked..
Please revert back for futher queries... try to come soon with an alernative solution...
Regards / Guru
Message was edited by:
Armin Reichert -
How to hide this method?
I want to use Protection Proxy Pattern,but I feel nervous about my
real method,how can i hide it(such as set it friendly or protected)?
you can see this code:
interface Safe{
public String getSecret();
class RealSafe implements Safe{
public String getSecret(){
return new String("You can get the secret");
class ProtectionProxy implements Safe{
private String password=null;
public ProtectionProxy(String temp){
password=temp;
public String getSecret(){
if(password.equals("I have the rights")){
RealSafe realobj=new RealSafe();
return realobj.getSecret();
else{
return new String("Illegal password,You can't get the secret");
How to hide the getSecret() in class RealSafe with the precondition of using Protection Proxy Pattern???????
How can i do? i need your help,please!You can't prevent a malicious developer constructing an instance of RealSafe. They could always decompile your application and make changes to it if they wanted anyway!
The ProtectionProxy is really just a convenience for users of your API. It provides "reasonable" security through a means of determining whether the current user has access to the data. It does not provide a means of determining whether the current developer has access to it!
Your proxy lays down the rules for accessing the class being proxied. This works when the client application plays by the rules (as most applications do).
So all you need to do is make sure that developers who play by the rules can't construct an instance of RealSafe:
public class SafeFactory
public static Safe getSafe(...)
Safe safe = new RealSafe(...);
return new ProtectionProxy(safe);
class RealSafe implements Safe
RealSafe(...)
class ProtectedSafe implements Safe
private Safe safe;
ProtectedSafe(Safe safe)
this.safe = safe;
}Thus the only way for a developer to get hold of an instance of Safe is to use SafeFactory.getSafe which always returns a ProtectedSafe.
Make sure you don't mistake this sort of pattern for robust security, though. It simply allows your client application to catch "UnauthorizedExceptions" and react accordingly. As pointed out in this thread there're various ways of getting at the data that's hiding inside a Proxy. If you're really concerned about preventing someone viewing your data unless they are authorised you need to either encrypt it or only load it (and not cache it) when their credentials have been provided.
Hope this helps.
Maybe you are looking for
-
Can I set up folders for major classifications of music as opera, country, etc. and then put all the albums with the genre into those folders folders?
-
In attempting to eliminate the preview pane (which I don't like) I accidentally eliminated the toolbar at the top. Since it's no longer there, I can't get the 'tools' option, and so I'd like to restore it. How?
-
Relation between Roles and Course/Object ID
hi Please tell me the HR-infotype having roles/position/job in relation with Course/object Id. HRP1000 have only courses . or please tell me how to make relation between two i.e. roles and course/object id S@chin
-
Help with a shopping cart idea
Hi All, I have been asked if I can do a shoppinng cart for a friend and initially I said yea Iknow of some ready made carts out there in ASP .. But I wondered if we could do our own in DW with some extensions? Is this hard or very complex? Id say I w
-
Cannot Send and Receive bbm to Curve 8520
Hi, I just came from Dubai and currently in the Philippines where I avail bbm promo through Smart. The customer service has changed my settings and has done too many reports to settle my blackberry issue wherein ?I cannot send message through bbm and