How to get the latest filename in a specify directory in client's machine
Hi all,
I've created a web application which user need to input some text and upload a file to server, It's simple that user just need to browse the directory to select the file. submit the form to server then ........
However, after user's review and they prefer the system can upload the latest file in a directory in the cilent's computer (as all files are stored in the same directory) and upload to server after user click submit button automatically. User only input the text in the form, no need to search the picture in the computer (can save time) .
I understand that there has some security issue. but just want to know is it possible to do this?
The question I would like to ask is
Can Java (servlet / jsp) can get the latest file in a pre-defined directory in client's machine?
pls help
thanks a lot.
Kin.
JSP and servlets run on the server, not the client. The client receives the output of the JSP/servlet, usually as an HTML page. Your question is: can an HTML page read a directory on the user's computer. The answer is obvious: no, it can't.
You may be able to work around this problem with some kind of plug-in, but this would likely create more inconvenience for the user, not less.
Similar Messages
-
How to get the latest credit limit values per each customer in the report.
Hi All,
Can anybody give me an idea on how to get the latest credit limit values per each customer in the report.
I have below requiremnt.
I have cube which is having transactional data on document and customer level .and it also having master data info object in the cube which is credit management view having all the customer numbers .
This credit management view is master data info object having credit limit key figure as attribute.These credit limit are per each customer.
So we need these credit limits in the report as dynamic values .(I mean whatever be the current credit limit in the master data table for that paricular customer that should show up in the reporting).
one more thing these credit limits should roll up correctly at the HTR level.
One HTR having number of customers .
for example HTR 100 can have customer number 200,300,400.
Those 200,300,400 customer credit limits should roolup correctly at the HTR 100 level.
Example below :
Cube DATA :
HTR Customer Doct number Credit managment view
100 200 10001 200
100 200 10002 200
100 300 10004 300
100 300 10005 300
100 400 10006 400
100 400 10007 400
100 400 10008 400
Master data tabel (P Table)(Credit managment view)
Credit managment view Credit limits
200 1000.00
300 50000.00
400 90000.00
Please remeber :
We can not make these credit limits as navigational becasue these are keyfigure attributes not characteristics.
one more thing we can not make them as charatistics because we need use these credit limits to derive other calkculation. so it is not possibel to derive calculations on charactristics .Create a formula variable of type replacement path with reference as attibutes of Credit management view and choose your key figure credit limit,say zcredit.
Now create a formula or CKF and use zcredit.
This should display the credit limit in your report as normal key figure.
I didnot get this part "one more thing these credit limits should roll up correctly at the HTR level.", may be the above will solve this too.Try it.
Hope this helps. -
How to get the latest creditlimits in the reporting
Hi All,
Can anybody give me an idea on how to get the latest credit limit values per each customer in the report.
I have below requiremnt.
I have cube which is having transactional data on document and customer level .and it also having master data info object in the cube which is credit management view having all the customer numbers .
This credit management view is master data info object having credit limit key figure as attribute.These credit limit are per each customer.
So we need these credit limits in the report as dynamic values .(I mean whatever be the current credit limit in the master data table for that paricular customer that should show up in the reporting).
one more thing these credit limits should roll up correctly at the HTR level.
One HTR having number of customers .
for example HTR 100 can have customer number 200,300,400.
Those 200,300,400 customer credit limits should roolup correctly at the HTR 100 level.
Example below :
Cube DATA :
HTR Customer Doct number Credit managment view
100 200 10001 200
100 200 10002 200
100 300 10004 300
100 300 10005 300
100 400 10006 400
100 400 10007 400
100 400 10008 400
Master data tabel (P Table)(Credit managment view)
Credit managment view Credit limits
200 1000.00
300 50000.00
400 90000.00
Please remeber :
We can not make these credit limits as navigational becasue these are keyfigure attributes not characteristics.
one more thing we can not make them as charatistics because we need use these credit limits to derive other calkculation. so it is not possibel to derive calculations on charactristics .
Edited by: sirisha Nekkanti on Oct 30, 2008 6:27 PM
Edited by: sirisha Nekkanti on Oct 30, 2008 6:35 PMThis is duplicate of
how to get the latest credit limit values per each customer in the report.
thread. -
How to get the latest procured value of a spare updated in material master
How to get the latest procured value of a spare updated in material master
J S S PRASAD
See table MBEW via transaction SE16.
However, you may need to look at the last PO created for that material.
PeteA -
How to get the latest versions of Internet Explorer t
We are running Single Primary Site with SCCM 2012 R2.
I
cant seem to find out how to get the latest versions of Internet Explorer to be included in software updates? Do you have to download this separately and install manually?Like Henrik said, make sure you have the Classifications selected that you want to address. IE 11 is the current browser, that was added to the catalog a few months back. If you are searching for this month you wont find it.
-
How to get the latest update for the phone?
hey does anyone know how to get the latest upgrade for my phone? 3230 nokia
http://www.nokia.co.uk/nokia/0,,58162,00.html
Gadget
Remember to mark all correctly answered questions as Solved. A forum is only as great as the sum of its parts, together we will prevail. -
HT1222 how I get the latest airport software update?
How i get the latest airport software update?
Marlon brown wrote:
I been trying to get this update off my phone but can not
I been trying to figure out what you're talking about but can not -
How to get the current executing file/itself absolute directory?
hellooo,
gentlemen/lady, how to get the current executing file/itself absolute directory?
thanks
Hello,
you can get the real path information of the JSP through the servlet context:
http://java.sun.com/products/servlet/2.2/javadoc/index.html
javax.servlet
Interface ServletContext
Method getRealPath
Christian Plenagl
Developer Relations Engineer
BEA Support
[email protected] (alex mok) wrote:
>hellooo,
>
>gentlemen/lady, how to get the current executing file/itself absolute
>directory?
>
>thanks
-
How to get the path when i select a directory or a file in a JTree
How to get the path when i select a directory or a file in a JTree
import java.lang.*;
import java.io.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.awt.HeadlessException;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Iterator;
* @author Frederic FOURGEOT
* @version 1.0
public class JTreeFolder extends JPanel {
protected DefaultMutableTreeNode racine;
JTree tree;
protected JScrollPane scrollpane;
final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
* Sous-classe FSNode
* @author Frederic FOURGEOT
* @version 1.0
private class FSNode extends DefaultMutableTreeNode {
File file; // contient le fichier li� au noeud
* Constructeur non visible
private FSNode() {
super();
* Constructeur par initialisation
* @param userObject Object
FSNode(Object userObject) {
super(userObject);
* Constructeur par initialisation
* @param userObject Object
* @param newFile File
FSNode(Object userObject, File newFile) {
super(userObject);
file = newFile;
* Definit le fichier lie au noeud
* @param newFile File
public void setFile(File newFile) {
file = newFile;
* Renvoi le fichier lie au noeud
* @return File
public File getFile() {
return file;
public JTree getJTree(){
return tree ;
* Constructeur
* @throws HeadlessException
public JTreeFolder() throws HeadlessException {
File[] drive;
tree = new JTree();
// cr�ation du noeud sup�rieur
racine = new DefaultMutableTreeNode("Poste de travail");
// cr�ation d'un noeud pour chaque lecteur
drive = File.listRoots();
for (int i = 0 ; i < drive.length ; i++) {
FSNode node = new FSNode(drive, drive[i]);
addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
racine.add(node);
// Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
tree.addTreeExpansionListener(new TreeExpansionListener() {
public void treeExpanded(TreeExpansionEvent e) {
// lorsqu'un noeud est ouvert
// on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
TreePath path = e.getPath();
FSNode node = (FSNode)path.getLastPathComponent();
addFolder(node);
((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
public void treeCollapsed(TreeExpansionEvent e) {
// lorsqu'un noeud est referm�
//RIEN
// alimentation du JTree
DefaultTreeModel model = new DefaultTreeModel(racine);
tree.setModel(model);
setLayout(null);
// ajout du JTree au formulaire
tree.setBounds(0, 0, 240, 290);
scrollpane = new JScrollPane(tree);
add(scrollpane);
scrollpane.setBounds(0, 0, 240, 290);
* Recuperation des sous-elements d'un repertoire
* @param driveOrDir
* @param node
public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
addFolder(driveOrDir, node, 0);
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Recuperation des sous-elements d'un repertoire
* (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
* @param driveOrDir File
* @param node DefaultMutableTreeNode
* @param level int
private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
File[] fileList;
fileList = driveOrDir.listFiles();
if (fileList != null) {
sortFiles(fileList); // on tri les elements
// on ne cherche pas plus loin que le niveau maximal d�finit
if (level > MAX_LEVEL - 1) {return;}
// pour chaque �l�ment
try {
for (int i = 0; i < fileList.length; i++) {
// en fonction du type d'�l�ment
if (fileList[i].isDirectory()) {
// si c'est un r�pertoire on cr�� un nouveau noeud
FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
node.add(dir);
// on recherche les �l�ments (r�cursivit�)
addFolder(fileList[i], dir, ++level);
if (fileList[i].isFile()) {
// si c'est un fichier on ajoute l'�l�ment au noeud
node.add(new FSNode(fileList[i].getName(), fileList[i]));
catch (NullPointerException e) {
// rien
* Recuperation des sous-elements d'un noeud
* @param node
public void addFolder(FSNode node) {
setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
for (int i = 0 ; i < node.getChildCount() ; i++) {
addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
* Tri une liste de fichier
* @param listFile
public void sortFiles(File[] listFile) {
triRapide(listFile, 0, listFile.length - 1);
* QuickSort : Partition
* @param listFile
* @param deb
* @param fin
* @return
private int partition(File[] listFile, int deb, int fin) {
int compt = deb;
File pivot = listFile[deb];
int i = deb - 1;
int j = fin + 1;
while (true) {
do {
j--;
} while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
do {
i++;
} while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
if (i < j) {
echanger(listFile, i, j);
} else {
return j;
* Tri rapide : quick sort
* @param listFile
* @param deb
* @param fin
private void triRapide(File[] listFile, int deb, int fin) {
if (deb < fin) {
int positionPivot = partition(listFile, deb, fin);
triRapide(listFile, deb, positionPivot);
triRapide(listFile, positionPivot + 1, fin);
* QuickSort : echanger
* @param listFile
* @param posa
* @param posb
private void echanger(File[] listFile, int posa, int posb) {
File tmpFile = listFile[posa];
listFile[posa] = listFile[posb];
listFile[posb] = tmpFile; -
How to get the records which has a specified x/y coordinates
Hi,
How to get the records which has a specified x/y coordinates. I have a table which has street data. And another table has a point data. Now I just want to get the records from street data which includes the points in the point data table. Can any one give your suggestions
Thanks and Regards
AravindanAravinda,
If you want to find the line segments which intersect the given
set of points, you can do that with SDO_RELATE.
siva -
Master Child tables how to get the latest rows from both
Hi,
Need some help with the sql. I have two tables Master & Child. In my Master table I have multiple rows for the same record and in the child table also multiple rows for the same master row how can I get the latest one's from both.
For example Data in my Master table looks like
CONT_ID SEQ_NUM DESCRIPTION
1 189 Update 2
1 188 Update 1
1 187 NewNow in the child table for the same CONT_ID I may have the following rows
CONT_ID UPDATED_DATE STATUS
1 3/16/2010 2:19:01.552700 PM P
1 3/16/2010 12:29:01.552700 PM A
1 3/16/2010 12:29:01.552700 PM P
1 3/16/2010 12:19:01.552700 PM NIn my final query how can I get the row with seq_num 189 as it's the latest in Master table and from child table the row with status of P as it's the latest one based on the time. Here is the query i have but it returns the latest row from the child table only and basically repeats the master table rows as opposed to one row that is latest from both:
ThanksHi,
You can use the analytic ROW_NUMKBER function to find the latest row for each cont_id in each table:
WITH got_m_rnum AS
SELECT cont_id, seq_num, description
, ROW_NUMBER () OVER ( PARTITION BY cont_id
ORDER BY seq_num DESC
) AS m_rnum
FROM master_table
-- WHERE ... -- any filtering goes here
, got_c_rnum AS
SELECT cont_id, updated_date, status
, ROW_NUMBER () OVER ( PARTITION BY cont_id
ORDER BY updated_date DESC
) AS c_rnum
FROM child_table
-- WHERE ... -- any filtering goes here
SELECT m.cont_id, m.seq_num, m.description
, c.updated_date, c.status
FROM got_m_rnum m
JOIN got_c_rnum c ON m.cont_id = c.cont_id
AND m.m_rnum = c.c_rnum
AND m.m_rnum = 1
;If you'd like to post CREATE TABLE and INSERT statements for the sample data, then I could test this.
If there happens to be a tie for the latest row (say, there are only two rows in the child_table with a certain cont_id, and both have exactly the same updated_date), then this query will arbitrarily choose one of them as the latest. -
How to get the specific filename
Hi..
I want to get the specific file where the filename contains current date like "asd.11.20051226.03.dat". Then, i want to write the filename to a text file.
Now, i only know how to get the list of file in a specific directory& write the whole list to a text file. How to filter the list of filename because they have "dot" in their name?To determine if a string contains a dot:I have a feeling that about 10 seconds after he figures out whether the filename contains a dot he's going to need to look a little deeper to determine whether he found wakka.wrongfile.txt or 11.20.1980.the.file.hes.looking.for.data. Maybe?
-
Urgent !!! How to get the Latest Exchange Rate from a list
Helo Gurus,
I want to get the latest exchange rate for all currencies in BI 7.0. Now when I checked in the table its showing all the exchange rates for various currencies according to the date. My client want the latest exchange rate in the report for all currencies. Now when I generating the currencies into the report the rate getting cumulated.
For certain currencies the rate is updated very recently. But for others two months back.
<b>How it is possible to take only the latest exchange rate for all currencies and can generate the report.</b>
I am working in BI 7.0 and the BEx using is of version 3.5.Mathew,
usually the currenies and other settings will be loaded nightly, but in your case if you want it urgently you can do this.
RSA1->Source System>Transfer Exchange Rates. This will open up a screen with two options Simulation and Update. You can verify with SImulation and needed you can update. It will not create any issues.
Hope this helps.
Alex (Arthur Samson) -
How to get the latest and valid BOM item entry from STPO
hi,
may i know with what condition we can get the latest and valid BOM item entry from STPO table?
i have STLNR and IDNRK as a input. But i realized that it would return multiple entry due to the combination of valid-from and valid till date.
can i use stlnr,idnrk and stpoz (with the latet counter) to get the latest and valid BOM entry?
thank you.Hi
You can get the latest BOM either by using the latest valid from date DATUV or latest internal counter STPOZ
Regards
Shiva -
How to get the latest update time of a info provider in ABAP
hi experts,
i am doing a ABAP program and need to get the latest update time of a info provider , does anyone know where it stores in BW or any other way to get it?
many thanks
WHYTable : RSREQDONE
you can give INFOPAK_ID as parameter and search for latest/last Request ID and dispaly time and Date.
Cheers
Praveen
Maybe you are looking for
-
I can't turn the Wifi on, Satellite L40-18Z
Hi there, I've been using Satellite L40-18Z but I can't turn on Wifi. I'm very sure that Tthe device is installed propery and I tried some ways to turn on Wifi device but never turned on. Of course, never catched the signal. Rooter has no problem eit
-
Hkey_local_machines\software\classes\.cdda error
When installing Itunes for the first time I get an error: Could not Open Key HKEYLocalmachines\software\classes\.cdda\open withprogids. Verify that you have sufficient access to that key, or contact your support personnel. I have ensured I was instal
-
Hi, We have custom PDF reports, where when we print it in Oracle the columns to the right getting chopped off, when I try to print the same copy to regular printer all the columns are getting printed on the same page. When I print the report to a reg
-
Photoshop Elements 10 not working
Yesterday when I loaded and registered my purchased Photoshop Elements 10 program it worked fine. This morning it would not load. When I tried to reinstall, I got the message taht the serial number is invalid. Thoughts?
-
Enterprise Manager Change Database
I just installed Oracle 10 and created two databases. The first one is called "deleteme" and the second one is called "test". I can access the database "test" by going to the URL http://computername.componanyname.com:5500/em/ but I can't seem to acce