Auto selection of file from folder during uploading??

Hi all friends,
Iam facing with one problem I am developing one uploading software for that i have used swing and servlet.Now my problem is i want to give auto selection of file from one folder means user just copy the files from any computer on network and paste it in predefind folder.And when they click on upload button it should start uploading of file one by one and after completion of uploading it move that file into another folder one by one.Now my software doing it perfectly but if user copy and paste any file in that predifined folder from network computer during uploading then they have to click upload button again after completion of first queue of files(for example if user first copy 10 files and start uploading and inbetween uploading of that 10 files if user copy another 10 files from network computer then they have to click on upload button again after completion of uploading of first 10 files).But my user requirement is they want to click on upload button once only at the time of starting my application and my application automatically select the file one by one from folder and send it to destination.Means if they copy the file from network machine inbetween uploading or any other user from network send file in that folder then my application should select those file automatically and start uploading means they don't want to click on upload button again.Can any one plz guide how I can slove this problem.Below r my codes:-
Upload.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
suspendflag=true;
Resume.setEnabled(false);
Suspend.setEnabled(false);
dest=frame.m_txtURL.getText();
File ff=new File("d:\\DTMS\\Upload");
File[] files = ff.listFiles();
fileList = new Vector();
if(files == null)
textArea.append("There is no file");
return;
else
for (int j = 0 ; j< files.length ; j++)
fileList.add(files[j]);
java.util.Collections.sort(fileList, new FileComp());//sorting by size
new Thread(new Runnable() {
public void run(){
for (int k = 0; k < fileList.size(); k++)//loop for queue {
File fname = (File)fileList.get(k);
String str=fname.getName();
log("Destination:" +" "+ dest);
log("Uploading Progress\nPlease Wait....");
result=doPost(fname,dest);//method for read file & send to servlet
String str2="Transfer apparently failed.";
String str3=result;
if(str2.equals(str3)){
Error(result);
else if(suspendflag==true){
File newfile =new File("d:\\DTMS\\Archives\\"+str);
fname.renameTo(newfile);
log("File" +" "+ str+" "+"Upload Completed !");
else if(suspendflag==false){
Error("** Transfer Suspended**");
}).start();
}catch(Exception exp)
Error("Error : " + exp.toString());
Regards
Bikash

Hi Chandan,
                    All the multiselection files are stored in it_tab( i:e file_table in method). you need to loop the every record to upload the data for selected files. please check the code Below...
DATA: file_str1 type string.
data: it_tab TYPE STANDARD TABLE OF file_table,
       wa_tab TYPE file_table,
       lw_file LIKE LINE OF it_tab,
       gd_subrc TYPE i.
SELECTION-SCREEN begin of block blk with frame title text-100.
SELECTION-SCREEN SKIP 2.
parameters : p_file like rlgrap-filename .
SELECTION-SCREEN end of block blk.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select only Text File'
default_filename = '.azt'
multiselection = 'X'
CHANGING
file_table = it_tab
rc = gd_subrc.
*READ TABLE it_tab INTO lw_file INDEX 1.
*p_file = lw_file-FILENAME.
Start-of-Selection.
loop at it_tab INTO wa_tab.
   file_str1 = wa_tab-FILENAME.
CALL FUNCTION 'GUI_UPLOAD'
   EXPORTING
     filename                      = file_str1
*    filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\test.azt'
   tables
     data_tab                      = it_string
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.

Similar Messages

  • Delete file from folder only (not from list)

    Hi all,
    I've searched a lot and didn't succeed so far, that's why I need your help. In a cloud context, I'm actually creating and uploading files (pdf and/or xml files) "on the go" to sharepoint folders via the SOAP API and this is perfectly working. But
    in a cloud context, I also need to decomission services which is translated into deleting files into Sharepoint.
    That's where it became complicated, because according to the API we cannot delete files if they are not part of a list structure, which is not my case. Is that true ?
    The only info I have when trying to delete a file via the SOAP Api is : its name, its folder, and the endpoint where the folder is. So my question remains simple I guess : is this possible ? If so, how to (a link to the SOAP body would be usefull)
    Thanks a lot
    Regards
    Baptiste

    Hi,
    According to your post, my understanding is that you want to delete file from folder.
    In SharePoint 2010, It is recommended to use Client Object Model to achieve it, the following code snippet for your reference:
    string siteURL = "http://siteurl";
    ClientContext context = new ClientContext(siteURL);
    //specific user
    NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
    context.Credentials = credentials;
    Web web = context.Web;
    context.Load(web);
    context.ExecuteQuery();
    string relativeUrl =web.ServerRelativeUrl +"/DocumentLibraryName/FolderName/FileName";
    File file = web.GetFileByServerRelativeUrl(relativeUrl);
    context.Load(file);
    file.DeleteObject();
    context.ExecuteQuery();
    If you still want to use SOAP API, we can use the UpdateListItems method under Lists web service to achieve it.
    http://www.dhirendrayadav.com/2010/06/delete-list-items-using-web-service.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/61466984-1844-48a1-8c1e-1c59a0f9876a/move-and-delete-files-remotely-using-sharepoint-web-services-?forum=sharepointdevelopmentlegacy
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • How to make button to format a HardDrive or USB, How to remove all files from folder, and How to delete a process in listbox with a textbox?

    Hello!
    Here's the question with explaniation: How can i format the USB or Drive by clicking a button what's meant for it?
    and the second question what's also in vb.net: How can i remove all files from folder ? 
     Here's the Look of program: *
    Using the PC button, it will delete the free space of the PC, do you guys/girls know where it's location?

    Example Code:
    Imports System.Runtime.InteropServices
    Imports System.IO
    Public Class Form1
    Dim CBoxDrives As New ComboBox
    WithEvents FButton As New Button
    <DllImport("shell32.dll")> _
    Private Shared Function SHFormatDrive(ByVal hwnd As IntPtr, ByVal drive As UInteger, _
    ByVal fmtID As UInteger, ByVal options As UInteger) As ULong
    End Function
    Private Enum SHFormatFlags As Integer
    SHFMT_ID_DEFAULT = &HFFFF
    SHFMT_OPT_FULL = &H1
    SHFMT_OPT_SYSONLY = &H2
    SHFMT_ERROR = &HFFFFFFFF
    SHFMT_CANCEL = &HFFFFFFFE
    SHFMT_NOFORMAT = &HFFFFFFD
    SHFD_FORMAT_FULL = 0 ' full format
    SHFD_FORMAT_QUICK = 1 ' quick format
    End Enum
    Private Sub FButton_Click_1(sender As System.Object, e As System.EventArgs) Handles FButton.Click
    If CBoxDrives.Text = "" Then
    MsgBox("No Drive Selected")
    Exit Sub
    End If
    Dim Iresult As ULong = SHFormatDrive(CType(Me.Handle.ToInt32, IntPtr), CUInt(Asc(CBoxDrives.Text.Substring(0, 1)) - Asc("A")), CUInt(SHFormatFlags.SHFMT_ID_DEFAULT), 1)
    End Sub
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Me.Size = New Size(200, 100)
    With FButton
    .Size = New Size(50, 25)
    .Location = New Point(5, 5)
    .Text = "Format"
    End With
    Me.Controls.Add(FButton)
    With CBoxDrives
    .Size = New Size(50, 25)
    .Location = New Point(75, 5)
    .DropDownStyle = ComboBoxStyle.DropDown
    End With
    Me.Controls.Add(CBoxDrives)
    Dim DrivesFound As Integer = 0
    Dim allDrives() As DriveInfo = DriveInfo.GetDrives()
    Dim d As DriveInfo
    For Each d In allDrives
    If ((d.DriveType = DriveType.Fixed) Or (d.DriveType = DriveType.Removable)) AndAlso Environment.GetEnvironmentVariable("SYSTEMROOT").StartsWith(d.Name) = False Then
    CBoxDrives.Items.Add(d.Name)
    DrivesFound += 1
    End If
    Next
    CBoxDrives.SelectedIndex = DrivesFound - 1
    End Sub
    End Class

  • Open File Dialog, Select either FIle or Folder, but Set the Initial Location to ftp://

    Hello,
    I want to be able to open a file dialog, set the initial location to an ftp:// address, and allow the user to select individual files or a directory.
    I can use the File Dialog express VI, and wire in a start path, but the problem is that the filepath constant does not allow you to input ftp://[IPAddress]. If you type it in it will automatically adjust the path to read . If you right click, and hit browse and go to an ftp site, the dialog will not let you select a file or folder. And no you cannot type the address into a string and then convert that to a path. If you do it will look just like the image above.
    I can use .NET functions as seen below, but it is not trivial to allow the user to select files or a folder. The same is true if I write it in C++ (although I haven't tried this yet, just googled selecting files or folders in a file dialog).
    EDIT: I just realized that with .NET if I select a single file, the FileName it returns points to a temporary internet folder on my computer for example: C:\Users\xxxxx\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\P01ODP0F\ni-rt[1].ini
    The FileDIalog Express VI has these very options.
    So what is the easiest way to have an initial ftp address path for a file dialog, and allow the user to select files or a folder?

    Have never had to do that before - that's a bit of a drag.
    Some thoughts.
    1) Can you map a drive to that FTP address and go from there?
    2) You could try rolling your own dialog via FTP - that's something I've definitely done before!
    In the following snippet, I start an FTP session on the NI FTP site, log in as anonymous, list the base directory files/folders and then close my session. I then unbundle the directory listings array and plug the name and item type into the item names of a multicolumn listbox.
    CLD

  • Hi,delete file from folder?

    hi,i am deleting file from folder as follwos
    <%@ page import="java.io.File" %>
    <%
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\xyz.txt");
    myFile.delete();
    %>
    i am sucessfuly deleted file from above path.
    if i use follwing code i unable to delete my file, can one help,
    how to do it,
    <%@ page import="java.io.File" %>
    <%
    String fname="xyz.txt";
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    myFile.delete();
    %>
    thanks
    pullareddy

    i think if above doesn't work try this it should work
    change this line
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    to this
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\"+fname);

  • Print PDF file from folder using SSIS

    Is there a way in SSIS to print pdf file from folder?
    ANy help much appreciated.

    One method is calling Adobe Acrobat Reader exe from Execute Process Task within SSIS passing the document path as the argument
    The command and arguments will look like this
    http://geekswithblogs.net/JeremyRamos/archive/2013/10/22/print-ssrs-report--pdf-from-sql-server-agent-or.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Read contineously file from folder

    HI
    I have 1000 of files and I want read files from folder automatic. Each file ends with
    if $BATCH_FILE==true
    define $END,false
    else
    power off
    define $END,true
    if 1 text file is finish then it should load another file automatically

    Hi kalu,
    don't know what you're trying to do:
    - you have a "path" control but you don't use it for ListFolder...
    - you get an array of filenames from ListFolder, but you don't use that data later on...
    - you are using "OpenFile"/CloseFile to get a file path (in the event) and later on you use that path to read data from...
    Your original question doesn't has anything in common with those things you do now...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Is there a way I can 'select all' for downloading purchase files via family sharing instead of selecting each file or folder one at a time?

    Is there a way I can 'select all' for downloading purchase files via family sharing instead of selecting each file or folder one at a time?

    or home sharing

  • Reading files from folder in java

    Hi ..I am new to java ..can you help me ..how to read the files from folder(containing 10 java files) and store in a array..
    Thanks

    use the java.io package, more specifically java.io.File. You can construct a new File by passing in a String version of the pathname, and then store that into your array.

  • Can I selectively recover files from my Time Machine Back-up?

    After installing the most current apps from the App Store, OS X 10.8.5, Safari and iTunes,my system became disfunctional. I did not back up my system before this happened. Before these updates, I had the spinning beach ball on opening and closing apps and applications quiting or freezing. Eventually, after trying to repair by various means, I couldn't access my desktop. I went into Recovery mode and did a backup of my corrupt system and reinstalled OS. I have a good basic system now but now I would like to know, "Can I selectively recover files from my Time Machine Back-up?"

    The basic answer is Yes, but it depends on what files. Can you give an example of what type of files and where they were located.

  • Select multiple files from a PC to upload to icloud

    I have icloud installed on my PC - I also have the the web link to upload files from my computer -
    I'm unable to get more than one file at a time to upload - HELP -
    I have 100's of files to upload to icloud - I'm mainly using pages and numbers -
    I have the latest software, etc - and am using an ipad 4 -
    thanks
      glen

    Hello tacomadm18,
    The following article details several methods for uploading documents to iCloud (including multiple documents). Note that, when selecting documents to upload, a single document in the group chosen that is not compatible will prevent the entire group from being uploaded (e.g.: choosing four Pages documents and one PDF will prevent any of the documents from being uploaded, whereas choosing only the four Pages documents will upload those four documents).
    iCloud: Access iWork documents stored in iCloud
    http://support.apple.com/kb/PH2704
    Cheers,
    Allen

  • New Lightroom catalog always selects and includes some files from folder Applications/Mail/Contents/Resources. Why? Mac Mini OS X 10.10.1. Lightroom 5.7

    Whenever I create a new catalog, Lightroom selects and includes some, but not all,  TIFF files from the folder Applications/Mail/Contents/Resources. Why does it do this: I don't select this folder to be included. Mac mini OS X 10.10.1. Lightroom 5.7.
    Help much appreciated.
    Regards
    Dan O'Neill

    Whenever I create a new catalog, Lightroom selects and includes some, but not all,  TIFF files from the folder Applications/Mail/Contents/Resources. Why does it do this: I don't select this folder to be included. Mac mini OS X 10.10.1. Lightroom 5.7.
    Help much appreciated.
    Regards
    Dan O'Neill

  • LR2 not auto stcking PSD files from editied Tiffs , only from edited CR2 ?

    If i have a raw file, and go "edit in" to CS4 and save the edit as a PSD it imports it to the library and stackswith the raw file no problem.
    But if I open a TIFF, that is also stacked to the raw, and edit that in CS4 and save that as a PSD it doesn't auto import it at all ?
    Why does it only auto import PSD files when they are created from a RAw file ?

    I did a bit more fiddling around with this and found out that to get it to import PSDsautomatically, when you use the "edit in" command for the TIF you need to select " edit a copy with lightroom adjustments"
    If you select " edit original"  or " edit a copy "  it does not work.   you will have to manuall syncronize the folder.
    So why is this ?  I can't follow adobes logic on this one.

  • Unable to atttach file from folder

    For some reason I can't attach files from my Photoshop folder ( One I created in my Ext HD that contains PS files ) to emails.
    I can attach files from other folders in the Ext HD ( Photostudio, eg. ) and I can attach files that are not in folders that are located in my Ext HD.
    I dragged a file from the Photoshop folder to my desktop and was able to attach it to an email.
    When I try to attach from the Photoshop folder the "selection box" pop ups. I'll click on the Ext HD and scroll to the PS folder. When I click on the folder after a while Mail will quit. I've sent several reports to Apple.
    Got any suggestions?
    Message was edited by: drowz1

    I'm not an expert at this but I think it is because you have to attach individual files from the folder to the email not the folder. I would also think that the size of the folder would prevent you from sending it via email. Most email accounts are limited to a max of 10MB per email.
    When I looked through Peachpit Learning Series it refers to attaching files or photographs not folders. You can hold down the Command key to click on and select more than one file or photo to attach.

  • Can I selectively copy files from TM backup after reinstalling OS from dvd?

    Hi everyone,
    I have searched both this forum and the web, and have not been able to find an answer.
    I have two separate questions. First, I have a 2TB external with a 1.5 TB partition for TM, and 500GB for my Aperture library and iTunes videos. I have TM set so it will back up the second partition on the same drive, as well as the internal HDD of my MBP and another external drive to the TM partition. This won't cause any problems when restoring will it? I don't have another hard drive right now to make another backup of the libraries, because my last one crashed.
    I'm planning on doing a reinstall of OSX from the dvds, (Apple's advice) and I was wondering if it's possible to selectively copy things from the TM backup? For example, I would copy the applications over automatically, but I'd want to pick and choose which of the other files to copy back.
    I want to be able to eventually get everything back the way it was with no problems, but I don't want to bring something back that was causing my original problems that caused me to reinstall OSX.
    If necessary, even starting out new, provided I could copy everything back again piecemeal, would be fine. I just want to get these problems to stop!
    Thanks!

    Thanks for your reply. I think that my problems are hardware related, but Apple wants me to try to re-install from scratch.
    What would I miss that's in the Library folder? The only thing I can think of that'd be hard to get back would be emails from Mail, as I think they are stored in there. However, I excluded one of my email address folders anyway, since it was 4 gigs, and it's a Gmail account anyway.
    I just want to make sure that I wouldn't lose anything important.
    Also, when I plug in the TM drive after reinstalling from scratch, it won't try to overwrite my backups with a new, almost blank one will it? I'm assuming no, but I want to cover all my bases, as I'm not that familiar with TM.
    Thanks for your help!

Maybe you are looking for

  • Windows Server 2008 R2 - You might not have permission to use this network resource. The request is not supported.

    Hello ! I have a server with Windows Server 2008 R2 (AD, File Server, DNS Server and DHCP Server) that not access network share other Domain Controller. Well, is very crazy. I view network shares by network computers and devices, but not \\domain_con

  • HT4906 I just upgraded to the new iPhoto and all of my old pictures are missing.

    As the title says. If I right click the library and open 'Packages', all of my old photos are in a folder called 'Originals' but do not appear when I open iPhoto. When I try to add them into iPhoto, I get an error telling me that they already exist.

  • How to position a check box in an ABAP query's selection screen?

    Hi Experts, I am working on SAP queries and for that I have created an infoset. There was a requirement to have a checkbox at selection screen, which we can obtain by Infoset-> Extras->"Selections" tab -> create a parameter as a checkbox. However, it

  • Matrox DualHead2Go

    Has anyone had personal experience with this device? I would like to add dual 24" LCD's to my iMac 24" for a three screen array. This device uses the DVI to VGA adapter and comes in an analog and digital version. They also make a triple version. My i

  • Configure email layout

    Dear forum, How i can configure the layout email for alert management module?.. Because the people who received the alert notification by email, the layout is not so informative.. Thanks