Reading File name, mimetype and size from FileUploadUIElement

Hi,
I am using FileUploadUIElement and I need to read filename, type and size in my Button click action.
I have seen the standard Test UI  elements component WDR_TEST_EVENTS which does this in wdDoModifyView method.
But is there any way to read them outside wdDoModifyView ? In a normal custom action event?
Thanks and regards,
Amey Mogare

Hi,
Yes you can definately do the same in any of the custom events implemented.
You will have to create a global attribute in the component controller say g_upload type ref to cl_wd_file_upload ( mark the Public checkbox ).
" Now in your view modify instead of,
  file_upload2 ?= view->get_element( 'FILEUPLOAD2' ).
" you say,
    wd_comp_controller->g_upload ?= view->get_element( 'FILEUPLOAD2' ).
Now create an action for you button and copy the rest of the code from view modfiy and place it in this method,
using wd_comp_controller->g_upload get the required values as follows.
* get the content of the filename property
  filename = wd_comp_controller->g_upload->get_file_name( ).
* get the content of the mime-type property
  mime_type = wd_comp_controller->g_upload->get_mime_type( ).
  wd_context->get_attribute( exporting name = 'FILECONTENT' importing value = filecontent ).
  size = xstrlen( filecontent ).
Regards,
Radhika.

Similar Messages

  • How to Read file name which we are dealing with ODI File tool

    Hi,
    We are using ODi10g version and we have requirement to move file from one place to another place. We are using ODIFileMove utility but we also want to read file name.
    Any help.
    Thanks in Advance.

    You can accomplish this with a fairly simple Jython script.  Use the os.listdir(<directory>) command to get the name of files in a given directory. 
    You can then (still in the Jython script) loop through the files and move them to a desired location (bypassing the OdiFileMove tool) OR use the Jython script to write the file names to a SQL table.  Then, use an ODI procedure to loop through the newly inserted records and store the file name in an ODI variable that you can then use in your OdiFileMove tool etc.
    I often refer to this blog entry from Gurcan Orhan as a starting point for this kind of task: Loading multiple files with ODI | Gurcan Orhan&amp;#039;s Oracle Data Integrator Blog

  • Need to get all the files, well music and video, from my ipod touch 5th gen to my itunes libary.

    Need to get all the files, (well music and video), from my ipod touch 5th gen to my itunes libary. (So basically sync the other way to normal)
    Laptop hard drive broke so had to buy a new one and obviously now need to sort out my itunes.
    Did try downloading all my purchased stuff onto itunes but it has missed some things off, and there are some files I did not purchase from itunes so need a way of getting them back on there.
    Sure this question has been asked a million times but can't find anything to help me on here so thought I'd ask.
    -Did have a look at going onto the start menu and opening the hidden items thing but couldn't see any reference to ipod or device on it so wasn't sure how to do it that way.
    -On itunes under my device when its connected, the section about manually restoring and backing up, would that help me? Because that says it will manually back up my ipod to my computer then could restore that back up, obviously I don't want to accidnetally get rid of everything on my ipod so didn't want to try that just in case without checking.
    (And yes I have disabled auto sync to device when conncected!)
    Can anyone help me please? Sorry if i've overcomplicated this!
    Thanks:)
    Chris

    Backing up an iOS device will copy some data to a backup file within iTunes, but this excludes all media.  You can also transfer iTunes Store purchases from the iDevice to iTunes but, without using a third-party tool, nothing else.  As long as you do not sync the iPod with your new library, the media that's on it will remain ... for as long as it keeps functioning, is not lost, stolen, eaten by the dog, ...
    You may also have an option to recover your previous library from your old laptop; as long as its hard drive isn't fried, a computer repair store or technician may be able to extract the drive, mount it in an external enclosure, and copy your data to another PC.  Whatever you choose, there is no real alternative to having all your media on your computer, managed by iTunes, and regularly backed up to another device/location.

  • Reading file name

    hello
    i used the step by step guide to develop a module for reading file name in a sender file adapter from Krishnakumar Ramamoorthy. (Thankyou very much for that guide)
    now when i use this module i get only one problem:
    the filename includes the source-dir as well.
    e.g.
    source-dir: /home/example
    filename: test.txt
    Filename in module: /home/example/test.txt
    why is the source-path included in the Filename?
    thanks alot for any help

    Hi Paul,
    you can always delete this inside your mapping:
    for instance trim the first 13 letters from /home/example
    then if your directory is always the same you'll have a filename only
    Regards,
    michal

  • Inserting automatic file name, date and time in Illustrator CS3?

    hello all,
    is there an option in Illustrator where you could automatically insert inside your file the file name, date and time where it was last created or modified, etc.
    I found this option to exist in InDesign, but could not find the same menu in Illustrator. I am using CS3.
    help?
    thanks a bunch.

    Mario,
    would you please be so kind to include a reference on your site about the script? As far as I can see, the PutDateandTime.js you are providing here is a copy or a slightly modified copy of the original script that Wolfgang Reszel has provided on our site for about four years.
    It is okay that the script is available on your site, but please not without a reference. Thanks.

  • MDM Sender Channel - reading file name

    Hi all,
    Is there any simple way to read the name of file sent by MDM when I am using MDM sender adapter ?
    I know if it's file sender channel, then we can read file name by writing a UDF. But just wondering about MDM sender adapter.
    Regards,
    -Shankar

    Hi Paul,
    you can always delete this inside your mapping:
    for instance trim the first 13 letters from /home/example
    then if your directory is always the same you'll have a filename only
    Regards,
    michal

  • Hey sur. my name anas and am from morocco i've just got a new iMac 2011 with OSX 10.7 and i want to downgrade to 10.6 please could you help sur to solve this it

    hey sur. my name anas and am from morocco i've just got a new iMac 2011 with OSX 10.7 and i want to downgrade to 10.6 please could you help sur to solve this it

    anas guellaf wrote:
    it still make 3 bips before starting the IMAC.
    That is another problem not related to the Mac OS X version you are trying to use.
    Three beeps at startup means you have a bad ram module in the computer.  Did you install the ram or did it come from another owner this way?  The first problem you need to solve is the bad ram.
    When the iMac starts, go to the apple left side of the menu bar, About This Mac, More Info, System Report, Hardware, Memory and see what the report is on the memory...does the iMac report all memory modules that have been installed as OK or does it show bad memory?  If there is not any information, you then need to remove the memory modules and restart one at a time to see which is bad.
    On the bottom of the screen there should be a small door that you can remove with a small screw driver.  You need to lay the iMac flat, disconnect the power cord, remove that small door and remove the memory modules.  You can then put two in (if it has four) and see if it starts without the beeps.  Do that with each module so you find out which is bad.  Once you know the bad memory, you can buy a new module, just like the ones installed, so the iMac starts without the beeps.
    Next, you cannot use a DVD for another computer for your iMac unless it is from one that is identical to yours.  So, you need to talk to Apple and have them send the DVD for your particular iMac.

  • Difference in File Adapter Read File as attachment and Use File streaming

    Hi all,
    As part of our POC we created a File adapter using the option Read file as attachment and File streaming we observed below things
    1.When we are taking “Attachment” option in file adapter, Its able to archive, but not supporting to write data to different location(using fileadapter’s write operation.)
    2.when WE are taking “ file streaming “ option in the adapter , Its not able to achive, but it writes data to different location(using fileadapter’s write operation.)
    Can anyone know is this is a correct behaviour . If yes what is the reason .
    Thanks
    Phani

    Hi all,
    As part of our POC we created a File adapter using the option Read file as attachment and File streaming we observed below things
    1.When we are taking “Attachment” option in file adapter, Its able to archive, but not supporting to write data to different location(using fileadapter’s write operation.)
    2.when WE are taking “ file streaming “ option in the adapter , Its not able to achive, but it writes data to different location(using fileadapter’s write operation.)
    Can anyone know is this is a correct behaviour . If yes what is the reason .
    Thanks
    Phani

  • Adobe error 1305 error reading file...and you have acces to it?

    adobe error 1305 error reading file...and you have acces to it? Can somebody help me with this? I'm trying to install Acrobat Pro XI

    See if any of the instructions provided at the following link help resolve the problem:
    http://helpx.adobe.com/creative-suite/kb/error-1305-try-install-product.html

  • FileChooser - "switch off" file name field and file type drop down choice..

    Hi there,
    I'm wondering, is there a simple way of not displaying the file name field and file type drop down choice that anyone knows of?
    Reason being; my FileChooser is embedded in an application window and does not pop up as a dialog - the users are only acessing one file type, but it could be in any folder on their machine.
    many thanks,
    Fergus.

    Moved to legacy SDK forum

  • Hello, I recently bought an iPad Air. Can anyone Please tell me How can in Transfer files like photos and videos from my win 8 computer to ipad ?

    Hello, I recently bought an iPad Air. Can anyone Please tell me How can in Transfer files like photos and videos from my win 8 computer to ipad ?

    Sync photos to iPad
    http://support.apple.com/kb/ht4236

  • How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?

    Greetings all,
    I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
    We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
    The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
    For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
    There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
    I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
    PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
    var myPresets = app.pdfExportPresets.everyItem().name;
    myPresets.unshift("- Select Preset -");
    var myWin = new Window('dialog', 'PDF Export Presets');
    myWin.orientation = 'row';
    with(myWin){
        myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
        myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
        myWin.myPDFExport.selection = 0;
        myWin.btnOK = add('button', undefined, 'OK');
    myWin.center();
    var myWindow = myWin.show();
    if(myWindow == true && myWin.myPDFExport.selection.index != 0){
        var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
        myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
        if(myFile != null){
            app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
        }else{
            alert("No File selected");
    }else{
        alert("No PDF Preset selected");
    So far my code does the following:
    1) Runs the Multi-Page PDF Import Script
    2) Runs PDF Export Script Above
    3) Toggles the Template
    4) Runs #2 Again
    5) Deletes the imported PDF and all pages and toggles template again.
    It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
    Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!

    If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
    Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
    It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.

  • Read file name from Payload (File Adapter)

    Hello experts,
    with Receiver-File Adapter I want to save a specific file. Name is given in the xml payload. I use Variable Substitution.
    My structure is like this:
    <root>
        <elements>
            <name>name1</name>
        </elements>
        <elements>
            <name>name2></name>
        </elements>
    </root>
    File name schema: %file%
    Variable Substitution:
        File Name: file
        Reference: payload:root,1,elements,1,name,1
    With this expression my file adapter creates two files (as recommended), but they have both the name "name1". I want to create n files with n different names, given by one xml structure. How can this task be done? Setting the occurency from "1" to "n" or "*" does not work.
    Thank you very much!
    Ilona Seifert

    Hi,
    Like pointed by you , your source strucutre,
    <root>
        <elements>
            <name>name1</name>
        </elements>
        <elements>
            <name>name2></name>
        </elements>
    </root>
    The target strucuture after mutlimapping will be like,
    My structure is like this:
    <root>
        <elements>
            <name>nameX</name>
        </elements>
       </root>
    Now, using Variable Name substitution, you will have the "name " element at a fixed level  always , <b> payload:root,1,elements,1,name,1</b> and so you Variable Name subsitution will also work fine.
    Hope it clears,
    Regards
    Bhavesh

  • Get specific filenames and sizes from a folder based on a list of variables

    Hi,
    I have a folder containing user's OST files, with various filenames:
    \\myserver\OST share\JBLoggs - Outlook 2010.ost
    \\myserver\OST share\CKent - Outlook2013.ost
    \\myserver\OST share\BAllan Myoutlook.ost
    There are several thousand files, and I need to get the file names & file sizes for 200 specific users only. I tried a for do in a bat file, but wildcards don't appear to be honored:
    "for /f %%a in (C:\Temp\UserNames.txt) do dir "\\myserver\OST share\%%a*" >> C:\Temp\Filenames.txt
    The * is not recognised as a wildcard, and the .bat fails (the dir command is parsed as "\\myserver\OST share\JBloggs*)
    I can do this manually via Excel, but it will be an ongoing task so I'd rather automate it. I've also tried Powershell, but am hitting policy restrictions (from my employer, not from Powershell), and no joy with Google. Any advice? (& thanks to all for
    looking!)

    Edit: Adding a PushD/PopD to the start and end of the bat file and removing the path from the dir command appears to have fixed it.
    Must have been something in the folder path that was breaking it, although since it maps fine through PushD & works when typed manually, I'm at a loss to explain what. Thanks for taking a look - appreciated!
    I'm not sure why it's working for you, but not working for me - I had assumed there was a syntax error/rule/additional switch needed in a For Do loop, so that is what I have been researching. There are definitely confirmed files that start with the usernames
    in my list. As an example:
    -My list & folder contains the variable DQuinn. When I run the bat file the following is displayed in the command prompt window I run it from:
    C:\Windows\System32>dir "\\myserver\OST share\DQuinn*"  1>>C:\Temp\Filenames.txt
    So the wildcard is treated as a literal * character, and not as a wildcard - in turn the dir command fails.
    (I'm not sure why 1 is displayed in front of the >>, but the txt file is written to correctly and removing the whole >>C:\Temp\Filenames section doesn't fix the bat file, so I'm not worried about that part).
    -From the same command prompt, if I run the command
    dir "\\myserver\OST share\DQuinn*"
    Then I get the expected output:
    Directory of \\myserver\OST share
    01/04/2015  02:47 PM       250,322,944 [email protected] - 2010.ost
                   1 File(s)    250,322,944 bytes
                   0 Dir(s)  4,288,303,345,664 bytes free
    Side note: I'm assuming the double a (%%aa) in your answer is a typo? I tried copying it just in case, but no joy :)

  • Reading file names in the unix box

    Hello,
    I did the following to read the files from the local directory.
    String s1 = "c:\samplefiles"
    File dir = new File(s1);
    if(dir.isDirectory())
    String listoffiles [] = dir.list();
    for(int i = 0; i <listoffiles.length ; i++)
    System.out.println(listoffiles);
    else
    System.out.println("Its not a directory");
    How can i read and print the file names in the unix box?
    Thank You.
    Kumar

    Thank You for the reply.
    In my custom page, i am trying to include a search page which includes date parameters based on which the pdf files in the unix box should be displayed in the page as a list. (The pdf file names start with the date).
    Once the user clicks the file names displayed in the page, i need to open the pdf. This part i can handle but to search the file names based on the parameter names and display in the page as the list is a bit confusing.
    Thank You.

Maybe you are looking for

  • Not able to delete File from Repository

    I try to delete a Folder with some files but it fails with a Error telling that my version is older then the one in the Repository. It says "The latest Version id: 8. Your inactive version id: 6" I just want to remove it completely. I am not sure how

  • Wired - SLOW / Wireless - FAST (WRT54G v.6 issue)

    Hello, We have a WRT54G v.6 wireless router and Verizon DSL with Windows XP.  Four computers total make use of this router to access Internet.  All computers are very new and in great condition. 3 computers connect to Internet wirelessly (laptop #1,

  • Witch cable for my videocamera to Imac

    I have an video camera with firewire 400 4 pins. On the Imac has no firewire system. How do I connect my camera to my Imac? Witch cable do I need? I use final cut prox, he doesn't reconize my camera?

  • Requiring Right Alt, remapping keyboard does not work

    I require the Right Alt button in a game. I can't change the settings of the game cause it's a lazy port from the playstation. I've tried remapping the keyboard with the program which rewrites the registry, it works when I use notepad or office, but

  • Adobe Reader recent files!!! Important!!!

    Does the recent file in the adobe reader le 1.5 to be specific adds up or consumes the space of your memory? if not then its ok. but if it does, how can i CLEAR ALL the RECENT FILE or DELETE THE RECENT FILE IN the adobe reader le 1.5!?!?!?!?!?! thank