Read and Write from Remote Shared directory

Hello everyone,
I'm working on an enterprise portal. One of the things i was asked to do is access a remote directory (like "\\machine\share\") and be able to, at least, list the files, download to the portal user any of them, and be able to upload some as well. Also my goal is to create dinamycally a directory inside the shared one for every record I insert into a database for, for example, creating a course (each course has an attachment of files with the schedules, curriculum, etc. in pdf or doc files).
Can anyone point me in the right direction on how to star this? are there any API's, packages or something like that that i can use?
Thank you in advance.

I have allready done that type of Project
I use FTP to Connect remote server. there is api call
com.enterprisedt.net.ftp you can download it free
also you can get the document of that API.
there is som sample code
import com.enterprisedt.net.ftp.*;
class remote
private String localPath,remotePath;
private FTPClient ftpClient;
public remote()
try
localPath="localpath to download";
remotePath="remote path from server";
ftpClient = new FTPClient();
FTPMessageCollector listener = new FTPMessageCollector();
ftpClient.setMessageListener(listener);
ftpClient.setRemoteHost(ip of the remote host);
ftpClient.setTimeout(10 * 60 * 1000);
System.out.println("connecting to the Remote Server....");
ftpClient.connect();
System.out.println("connected to the Remote Server ");
ftpClient.login(username,password);
ftpClient.setConnectMode(FTPConnectMode.PASV);
ftpClient.setType(FTPTransferType.ASCII);
downloadFiles();
catch(FTPException ftpe)
System.out.println(ftpe.toString());
catch(Exception e)
System.out.println(e.toString());
public void downloadFiles()
try
String [] remoteFileList;
String localFileName;
remoteFileList=ftpClient.dir(remotePath + "/");//get the Remote
//file list
for(int j=0;j<remoteFileList.length;j++)
( localFileName =localfile //filter only fileneme from remotFileList[J])
ftpClient.get(localPath + localFileName, remoteFileList[j]);
System.out.println("Successfuly Downloaded " +
ftpClient.quit();
catch(Exception e)
System.out.println(e.toString());
from Jinath
Message was edited by:
JBN

Similar Messages

  • I'm trying to share folder between users on a single mac.  I put the folder in "shared," set permissions so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    I'm trying to share a folder between users on a single mac.  I want both users to be able to read and write so the folder stays current on both accounts.  I put the folder in "shared," set permissions on folder so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    Did you log out of one account and into the other or just used Fast user switching?
    Is the permissions set to anyone?
    When you move data to teh Shared folder is it copied or just moved?
    If copied then it's not a folder both can access, just a way station like a USB thumb drive that things are coped too and off of likely.
    You can run this #5 on each user account to reset the user permissions once they are taken back out of the Shared folder
    Step by Step to fix your Mac

  • ITunes Library on an Airport Disk?  Read and write from multiple Macs?

    OK, I've scoured the forums for an answer to this, but haven't found anything definitive. Apologies if I've missed the answer, but here's what I want to know:
    I have an iMac as a primary computer, plus a Mac Mini hooked up to my entertainment system, and my girlfriend's powerbook in the house too. There seem to be two main iTunes options: either constantly try to keep all three iTunes libraries synchronised by running around importing files, etc.; or just keep one library, and share it over the network.
    Right now, I am keeping my iTunes library on my iMac and sharing it with the Mac Mini and the powerbook. If anyone wants to add music (or other content) to the library, it has to be through the iMac. Obviously the iMac has to be on for any other computer to access the shared library.
    I want to try to make things simpler by having a single "network" iTunes library that all computers to be able to share (read AND write). I envisage having this "iTunes Server" on an external HD connected to my Airport Extreme as an Airport Disk. If I move the entire contents of ~/music/iTunes (including artwork, library files, etc) to this central location, will the three Macs be able to deal with this, ie can multiple computers share an iTunes library database on an airdisk? Will I be able to stream content from this library to all three computers? Will I be able to import new music into the library from any one of the three computers?

    I am having a very similar problem. I have all of my music saved on a large external disk connected to my airport. I would like to be able to just play what i want from this disk, but i don't like having to download every track i want to listen to. I still want to be able to bring my laptop with me and have some music so i don't want to make this external disk my library folder. Is there a way to play it on my computer similar to a shared library on another computer? Am i asking to much out of apple?

  • Read and write from access

    I am arun, a beginner in the field of LabVIEW. Now I am trying to read and write data from MS Access with out database connection toolset. How this possible. How I can use activex in Labview for doing this. Please give me some reference materials.

    Hi Arun,
    The following discussion forum talks about the same issue, and provides a good explanation and references for the different options. Also, which version of LabVIEW are you using?
    How to read/write from Access database
    Thanks,
    Lesley Y.

  • Read and write access for shared folders shouldn't be enabled but it is.

    I have an external hard drive with all my media stored on it. This is shared over the local network so that others on my network can access it.
    However I set it u for read only access (I dont want the rest of my family to be able to delete files) but it persists to have read & write privaleges.
    Im sure im missing a really obvious point but I can't work it out. So was hoping someone could help.
    In System Pref-Sharing-File Sharing the folder is shared with 3 users added:
    Alastair Riddle (Read and Write) <----My account
    Staff (Read Only)
    Everyone (Read Only)
    I have applied permission to all folders, but guests appear to be able to log on and have full read write privaleges.
    Your help would be appreciated,
    Ali

    I'm no expert on this one, but for the others to be included under the Staff heading, I believe they have to be added to that group.
    It may be easier to add them by name and set to read-only, and add an entry for Guest as read-only.
    And ensure that the external drive has Owners Enabled.

  • Rs232 read and write from pressure transducer with command.

    New to LabVIEW and have my first task. I have connected to a Setra pressure transducer via rs232 in Com port 4. I'm trying to track and log pressure over a given period of time. A command of "P" must be sent to the transducer for it to return a pressure reading. By searching, so far I have VISA open, close, read and write on my block diagram. I tried to create a constant from the VISA read resource name and connect it to COM4, but that did not work. Not sure how to accomplish my goal or how to wire everything up correctly. Any help for a beginner is appreciated.

    That error is due to some process already having exclusive rights to the port.  Do you have Hyperterminal or something else the could be using the COM port open?  Did you not close out the VISA reference during previous runs?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can i format an external drive so as to read and write from both windows and mac side

    i recently bought a macbook pro and used bootcamp so as to be able to run win7 and mac. I now wish to have an external drive so as to backup and tranfer files between the two os's. Specifically to read and write form either windows or mac. How can I do this?              

    Format it as FAT.

  • How to read and write from XL file

    HI ,
    I wanted to read a data from XL file and write a data in XL file by generating a report .Can any body help me out.Many examples are available on discussion forums but when I try to save and run those Vi .I am not able to run Showing error .Please tell what is going wrong as I m having latest labview 8.6 .
    Regards
    Sharmila.karale

    Hi Adnan,
    Here are the examples of Vi which I have downloaded from the forum for my reference
    Regards
    Sharmila.Krale
    Attachments:
    SAVE TO EXCEL.llb ‏128 KB
    excel.llb ‏1618 KB

  • Read and write from and to text file

     Hi All,
    I am trying to read some portion of a text file and make measurement and calculation with those numbers and write back to the same text file and also to a excel file. I need to create a 2 D  array of 20 by 20 from the text file values and write to front panel table and to text file. but I am having problem with it, obviously I am new to this. Please help me.  thanks much
    ~ Johnny

    Hi Lynn,
    the requirement is to move C1 and C2 to each position that is given in the text file in steps and percentage value.
    for example C1 has to go to first step (5%) and C2 has to go thru all steps, 5% to 95% , in 5 percent increment. 
    each 100 steps translates to 1 percent increment in the capacitor value.
    at the end, I need to enter the measured data (values of C1 for each step, vesus all values of C2 for all steps) and enter them at the bottom of the text file's table where it starts at : "IMPEDANCE_REAL in Ohmone line per C1 position, containing all values for the different C2 positions" and do the same for where it says "IMPEDANCE_IMAGINARY in Ohmone line per C1 position, containing all values for the different C2 positions"
    the reason I read the file twice, is that if it read it once, I couldn't connect it to spreadsheet string to array vi.
    as you can see, I also like to use the write to measurement file and build table express vi's to display the table on the front panel and save the data to ni data file format so later I convert it to excel  too.
    any thoughts?
    thanks for your help
    ~ Johnny
    Attachments:
    read from text2.vi ‏82 KB

  • Need easy fix to make my external HD read and write from PC to Mac user

    Ok. So I got a MacBook pro. Changing from PC. I have 2500 songs on my iTunes file which is on an external hard drive. This is where I keep it. It was a sinch directing iTunes to where my music files and playlists were but needing to add more songs in the playlists from this hard drive that has all my other music is apparently impossible. Mac only reads this ext HD and can't write because it's NTSC. OK, I googled to try and find a fix. Macfuse nor NTSC3g worked. I don't want to buy another thing for this after spending $1200. Nor do I want to take the time to reformat 20,000 songs in an external HD from NTSC to FAT. is there a better way? I specifically asked the clerk in the apple store if this was going to be a problem. He said no of course. But apparently it is a problem. Anyone got any ideas before I take this laptop back?

    Here are all the NTFS mounting, read and writing utilities available for the Mac.
    http://www.macupdate.com/find/mac/ntfs
    Read the reviews, download the demos, try them out.
    Can I ask how big your external HD is? Why not buy another external drive and copy your music files from the NTFS formatted PC drive to a Mac formatted drive.
    You will need another external drive for backuping up your MacBook, anyway.
    You do have a backup plan for your MacBook?

  • How to read and write from the serial port using java

    can anyone tel me how to capture data from a serial port and display on the screen and also store it in a database.

    Java Comm API, JDBC

  • HELP HELP REQUIRED!!!!!! Reading and Writing  from and into a Telnet Window

    Hi,
    I need to read and write into a Telnet window .But the Telnet window is a exe program that is been given by the Windows while installing the OS. Another thing is that I need to read and write into/from the Telnet window at a specific X and Y positions which will be defined in the database . I did searched for a dll of Telnet which can contain some APIs to achieve the task but I was unable to fine one.
    Even if u wont be able to provide me the perfect solution , Please guide me how to read and write from a executable window .
    Any help will be highly appreciated.
    Thanking in Advance.
    Mannu26.

    Hi Guys ,
    Thanks for the comments , atleast I got few but none were of any use to me. If u can Please help me on this topic it will be very kind of you .
    Take Care.
    Manoj.

  • How to share files in a network and allow read-and-write to a specific computer only?

    I have several computers in my network, and I want to share a folder and allow read-and-write from computer A to Computer B only, and omit computer C. How do I do that? Thanks.

    Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
    Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
    ajt

  • Process using Webservice in Reader and Writer becomes slow while connecting processors

    Hi,
    I have a process that reads from a web service and writes to a web service. When I try to modify the code(after stopping the running process) by adding new processors or change the current connections, the connecting arrows take forever to connect and sometimes the director hangs for a long time. There is no issue in other processes where I read and write from staged data.
    How to overcome this isue?
    Appreciate the help!
    Regards,
    Ravi

    Hi Nick,
    Thanks for the advice. In the scenario where upgrade is not an option, is there any workaround to this issue?
    What I've found is if I strip the next processor of all its connections, then it gets connected to the previous processor pretty quick.
    EDQ hangs if the processor has other input/output connections and I try to connect it to another processor)
    P1>---<P2>    <P3 ---------- P2 to P3 connects fast as P3 is standalone
    P1>---<P2>    <P3>---<P4> ---------- In this case,  when I try to connect P2 to P3, it hangs forever.
    I've a complex process and just for adding a few processors in between, I will not be able to connect the rest of the processors all over.
    Regards,
    Ravi

  • Fast way to read and write console

    hi guys
    what's the fastest way to read and write from console?
    For writing I'm using (I think thats the fastest way)
    System.out.println(foo)and I have to read the following - all numbers are ints (that means m + n + 1 lines):
    1 * "<n> <m>"
    n * "<a> <b> <c>"
    m * "<a> <b>"Actual I'm reading (the second line for example) with
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] items = br.readLine().split("[^\\-\\.0-9]+");
    Target mainTarget = new Target(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]));
    for (int i = 1; i < m; i++) {
        items = br.readLine().split("[^\\-\\.0-9]+");
        mainTarget.addTarget(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]));
    } But that isn't really fast...
    have you any idea?
    grz faetzminator

    faetzminator wrote:
    right, I have 1 + 1 + 1 =3 up to 10^6-1 + 10^6-1 + 1 =2*10^6-1 input lines with max 4999997 integers (and I have to store 2999999 of them)
    ok, if that is the fastest way... (maybe the reading of the input file is so slow; I run eg "java Foo < input > output")All those br.readLine calls where you never check if the return is null are dangerous.
    I really don't understand what you are doing. You mentioned System.in at first and now reading from files.
    I also am pretty sure that you are in fact running out of memory.

Maybe you are looking for

  • App Store Genius only on iPhone (not desktop) ???

    Why is the genius feature for the app store not accessible from my laptop running itunes? you would think that this would be the other way around... usually the mobile device is missing some features of the desktop. all in all i like the new version

  • Sender File Adapter Problem when text document is a single line.

    Hi All, I have posted this question earlier too. But did not get a proper answer. I am using File adapter to fetch data from a file system. My input data is: AA123BB45678AA345BB78564. It is just reading the first segment i.e.AA123 and not reading the

  • Installilng PS on new iMac

    I'm having trouble migrating my PS from my old MacBook Pro to my new iMac. Migration Assistant did not work, and tech suggested I copy all the PS CDs to an external HD and then attach the HD to the new iMac. Then do an install to the iMac from the ex

  • Maximum size of autoextend reached

    Hi ALL, I am using oracle 10R2 in Sun Solaris, i recevied the error Maximum size of autoextend reached. i dont know what to do. initial this datafile have 1gb space recently we added 1GB more. i am not sure it will be the reason for this. Kindly advi

  • Lightroom crashes after photoshop closes file

    I'm having an intermittent problem.  Here's what happens: 1) Right click on .DNG photo and do edit in photoshop. 2) Do my photoshop work, which will include usually 10 layers and be around 300 MB in size 3) save and close file 4) go back to lightroom