How to get file from temp foldre using StorageFile.GetFileFromPathAsync()

Hi,
I am trying to download a .pdf in the temp folder.
Here is the code
var uri = new Uri("http://www.nakcollection.com/uploads/7/7/7/4/7774039/the_man_in_the_red_underpants_book.pdf");
StorageFolder folder = ApplicationData.Current.TemporaryFolder;
StorageFile file = await folder.CreateFileAsync("one.pdf");
BackgroundDownloader download = new BackgroundDownloader();
DownloadOperation downloader = download.CreateDownload(uri, file);
StorageFile file1 = await StorageFile.GetFileFromPathAsync("");
Now I want to use that file how can I get that file using
StorageFile.GetFileFromPathAsync("");
samEE

Thanks, a lot it worked :)
Here is the revised version of the code. It might help others too. :)
var uri = new Uri("http://www.nakcollection.com/uploads/7/7/7/4/7774039/the_man_in_the_red_underpants_book.pdf");
StorageFolder folder = ApplicationData.Current.TemporaryFolder;
StorageFile file = await folder.CreateFileAsync("one.pdf",CreationCollisionOption.ReplaceExisting);
if(file !=null)
//Download form uri to file
BackgroundDownloader download = new BackgroundDownloader();
DownloadOperation downloader = download.CreateDownload(uri, file);
//set download priority
downloader.Priority = BackgroundTransferPriority.High;
//request uncontrained download
UnconstrainedTransferRequestResult result = await
BackgroundDownloader.RequestUnconstrainedDownloadsAsync(new DownloadOperation[] { downloader });
// start downloading
await downloader.StartAsync();
//the download is now finished
var tempUri = new Uri("ms-appdata:///temp/one.pdf");
StorageFile file1 = await StorageFile.GetFileFromApplicationUriAsync(tempUri);
if (file1 != null)
//user defined function for further usage of file
LoadFile(file1);
samEE

Similar Messages

  • How to get file from FTP Server using File Control

    Hi,
    Any one did getting file from FTP Server?
    Please let me know any one help me.
    I would need to get file from FTP Server.
    Thanks,
    Madhu

    Yes I have done that. But In FTP Server I cannt read file, because no previliges. Only I need to copy file from FTP Server to local server then only I can read that file.
    I tried all options using FileConrol(getFiles(),read()).
    getFiles() - It wont copy the file, it give information about file.
    read() - I dont have previliges to read the file.
    Please tell me any other procedure would be there for getting file from FTPServer.
    Thanks,
    Madhu

  • How to get file from server while click on link

    Hi,
    i created on link and i gave one server path to select file from server but while clickinng on link it no displaying any thing.
    following is the Destination url that i gave for the item.
    /u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/
    please tell me how to get file from server while click on link.

    Ok I got your requirement now.
    If you are getting file names from view attribute then you should not be adding destination URI property for the link.
    Instead you can use OADataBoundValueViewObject API.
    Try below code in your controller processRequest method:
    I am assuming that you are using classic table.
    Also in below example it considers OAMessageStyleText and you can replace it with link item if you want.
    OATableBean tableBean =
    (OATableBean)webBean.findChildRecursive("<table item id>");
    OAMessageStyledTextBean m= (OAMessageStyledTextBean)tableBean.findChildRecursive("<message styled text in table item id>");
    OADataBoundValueViewObject tip1 = new OADataBoundValueViewObject(m, "/u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/"+"<vo attr name which stores file name for each row>");
    m.setAttributeValue(oracle.cabo.ui.UIConstants.DESTINATION_ATTR, tip1);
    Regards,
    Sandeep M.

  • How to get resultset from oracle procedure use ejb3

    how to get resultset from oracle procedure use ejb3
    i know oracle procedure should like this
    Create or replace PROCEDURE resultset_test(
    aaa IN NUMBER,
    bbb OUT sys_refcursor) ....
    but what s the ejb3 scripts looks like? please give me an example or link~
    ths

    - there are no EJB3 scripts, only compiled application code
    - the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
    Now you should know what to Google to get your "example script": "java jdbc oracle procedure"

  • How can I get file from multiple instance using file adapter

    Hi.
    Our system(PI7.1) have three application instances running with each physical servers.
    We use sender file adapter.
    The file data is sent to one of the servers.
    Now, how can I get the file using three file adater?
    Should I put the file "sapmnt(\usr\sap)" .
    Or are there another solution?
    regards,

    Hi Ashutosh
    You will have to use sapcar.zip which contains the utility Sapcar.exe utility for unzipping the files from SAP compressed files. (*.car file)
    Regards
    Gaurav
    PS: Reward points if solved

  • How to get files from application server

    Hi
    I got a requirement like i have some n number of file in application server at specified path now i want to get that files from application server to presentation server.
    Please help me out.
    Thanks in advance.
    Regards
    Krishna

    HI.
    Use this Unix script. Give IP and other details as ur requirment.
    Setup variables. #
    Input Directory > #
    Output Directory > #
    Source System > #
    Target System > #
    Files FTPed > lxxxxx* #
    set -x
    DATE="`date +%y%m%d%H%M%S`"
    FTP destination details.
    ftp_host=""
    ftp_user=" "
    ftp_pass="a"
    ftp_remote_dir=" "
    File path and names
    host_dir=""
    ftp_local_file="lxxxx"
    ftp_local_file_dir=" "
    ftp_arch_dir=" "
    ftp_output=" "
    FTP
    if -f $ftp_local_file_dir ; then
    ftp -i -n -d -v $ftp_host<<EOINPUT >$ftp_output
    user $ftp_user $ftp_pass
    cd $ftp_remote_dir
    lcd $host_dir
    mget $ftp_local_file
    bye
    EOINPUT
    mv $ftp_local_file_dir $ftp_arch_dir$ftp_remote_file_name
    else
    echo "ERROR: Local $ftp_local_file_dir does not exist.">>$ftp_output;
    fi
    exit;
    Edited by: Jay on Feb 14, 2008 5:36 PM

  • How to Get file from Server (via AL11)

    Hi Team
    I have a requirements like getting the file from the server if Application server is check.
    Once i have press F4 button on the file parameter, shown dump .
    i am using FM /SAPDMC/LSM_F4_SERVER_FILE under AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_apath.when i am pressing F4 button to findout the file directory it shown dump like
    MESSAGE E019(/SAPDMC/LSMW).
    My system is ECC 6.0 Develoment .
    Please have a look and let me other alternatives to get the file from application server.
    In Advanced Thank you.
    Thanks & regards.
    Puneet.

    Hi Gautam,
    i have tried as per given FM but problem is that while reading the file it gives sy-subrc 4. file is already situated correct directory then gives error.
    So please give me other function module which is similar functionality as
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
            EXPORTING
              directory        = c_space
            IMPORTING
              serverfile       = p_w_file
            EXCEPTIONS
              canceled_by_user = 1
              OTHERS           = 2.            
      Thanks.
    Puneet.

  • How to upload files from a form using pl/sql ?

    Hi
    Is it possible to upload the physical files outside the database (under UNIX server)using pl/sql? I already know how to store the files inside the database(wwwdoc_documents$) but I didn't find any documentation about storing the physical files outside the database.
    I have in my form the following component:
    <input type="file" name="upload">
    and I want to let the user browse for the file on his/her disc that he want to use. What I want to do next is to save a copy of that file on our file-server, and then use it in my application. How do I do that in pl/sql?
    Any help will be appreciated.
    Sebas.

    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

  • HT201304 how to get files from my stolen iphone4

    how do i get my files from my iphone that was stolen

    Hi,
         It depends on what files, what you had synced to Itunes or Icloud and when you last did a sync.
    If the phone is gone and or wiped you can forget that. You next chance is from sync sessions and backups.
    Do you have a new Iphone yet?
    Cheers!

  • How to get data from live site using C# on grid view

    hi, how am I able to get data from a website and display it in a grid view ?
    Can anyone show me how I would do this? Thanks

    Hello,
    This post does not fit to this forum, read the
    stickies.
    Regards, Eyal Shilony

  • How to keep files from disappearing when using Dynamic link to AE in PremProCS4?

    I am at my wits end here and hope someone can offer a solution.  I use Dynamic Link in PremProCS4 to link a clip in my timeline to AfterEffects.  I follow the instructions in my book and everytime I close my files and reopen..I loose the clip along with the effects...I get the place card instead.  Here are the steps I do as per the Adobe Classroom in a Book Explains:
    I double click on my .MTS file in the Project Board so it comes up on my Source Screen.
    I take select the part of the clip I wish to use in my timeline and drag it to the appropriate spot on a video layer.
    I then right click the "clip" and select "Replace With After Effects Comp"
    I then name the new file.  name or whatever.aep
    It opens in AE
    I then apply two simple effects... keying and a cartooning effect I use from NewBlue Cartooner.
    As instructed I then go directly back to PremPro and do a "render" by pressing the Enter Key.  This does not work since I only get a yellow bar above the clip instead of a red on???
    So then I save the PremPro project and close it then go to the AE project, save and close it.
    When I reopen PremPro the file has a place card in it and in AE it says I am missing a file.
    I have tried many different ways to do this process including re-importing the .MTS file.
    I can close PremPro and reopen it and all is the same as long as I don't close the AfterEffects project.  Once AE is closed it looses the file.  On a note here I keep all my computer source files in the same place and it never changes plus they are in my PPro Project as well.  I never change the names so this isn't this reason.
    Is there a tried and true method to select a piece of clip in the video layer in Prem Pro and add effects from AE and not have it misplace the files?
    Thanks  Kate

    Hi Curt, and thank you for taking the time to respond.
    Its odd how I've been trying to figure this one out for a long time and I tried your suggestion but it didn't make any difference..darn.
    In the AE forum they say this is quite common and no one really knows why...double darn.
    So I went back with a fresh mind this morning and tried something else..and it worked...so far anyway.
    So far I figured it out... I guess I just needed to ask the question and write it all out to help get my brain working in the right direction: 
    Since the normal process to do this doesn't work for me ..and apparently many others..here is the solution for those of you having similar issues.
    In PremPro select the desired clip you wish to place effects on
    Rename it and save
    R click and "Replace with AE composition"
    Name new file
    You will see three files pop up in AE in the project panel.
    The original source clip .. in my case.. shows an icon that lets me know it isn't the true file.
    Highlight this file with a click and then go Ctrl H (for PCs)
    The group of computer source clips you use for your project will come up.. double click on the original clip you had imported into your PPro project.
    The source file icon in AE will change to an icon that denotes the true file...save
    Go to your still open Ppro project and make sure it carried the effects over..save.
    Now you can save and close the AE project.
    So for this works for me today and I hope this helps anyone else dealing with a similar issue.
    Thanks.

  • How to get listitems from different lists using Js

    Hi,
    I want to search my web for all the lists that contains a certain checkbox column (get it by name).
    Once I have this list, I want to iterate through all of them and get the list items with this column checked.
    I got the lists, but when I tried to get the fields - I got an error - the system doesn't recognizes the fields.
    To be more specific - in the code I've posted below in method onGetFieldsSuccess I'm getting an error in the first line, as I can't retrieve the enumerator.
    In the MSDN I saw how to retrieve list's fields, but there it was a specific list. Is there a way to get the lists who have a specific field?
    Any help will be appreciated
    <script> 
    ExecuteOrDelayUntilScriptLoaded(showFavorites, "sp.js"); 
    var ctx;
    var lists;
    function showFavorites()
         ctx = new SP.ClientContext.get_current();
         var web = ctx.get_site().openWeb("/legal");
         ctx.load(web);
         lists = ctx.get_site().openWeb("/legal").get_lists();
         ctx.load(lists);
         ctx.executeQueryAsync(Function.createDelegate(this, this.onGetListSuccess), Function.createDelegate(this, this.onFail));
    var list;
    var fields;
    function onGetListSuccess(sender, args) {
              var listEnumerator = lists.getEnumerator();
              while (listEnumerator.moveNext()) {
                   list = listEnumerator.get_current();
                   ctx.load(list);
                   fields = list.get_fields();
                    ctx.load(fields , 'Include(Title)');
                   ctx.executeQueryAsync(Function.createDelegate(this, this.onGetFieldsSuccess), Function.createDelegate(this, this.onFail));
    function onGetFieldsSuccess(sender, args)
          var fieldEnumerator = fields.getEnumerator();
        while (fieldEnumerator.moveNext()) {
            var field = fieldEnumerator.get_current();
            var name = field.get_staticName();
            if (name == "MyFavorite") {
                alert(list.get_title()); 
                break;
    function onFail(sender, args) {
        console.log(args.get_message());
    </script>​​​​​​​​​​​​​​​​​​​​​​​​​

    Thanks a lot Thriggle,
    I've used your advise, and other then some syntax problems (as you predicted :) everything worked just fine!
    (I had to add another executeQueryAsync to get the listItems files - but that wasn't a problem).
    The only issue that I have is that it takes FOREVER to load, and once it does load - it returns duplicates of the same results (sometimes 3, sometime up to 10).
    I only have 13 tables with about 50 list items in each table, and from that only 6 tables have the specified field - so it shouldn't have taken THAT long (sometimes I see the results after 45 seconds after the page finished loading).
    should I have used a new client context for each query? or is there a place where I'm getting unnecessary loops (I've made sure that I have only 1 list item that matches the 
    I'm resending the complete code. maybe there's something I've missed here.
    <cfheader name="X-XSS-Protection" value="0"></cfheader>​​​​​ ​​​<script>
    ExecuteOrDelayUntilScriptLoaded(showFavorites, "sp.js"); 
    function showFavorites()
         var displayTable = document.getElementById("myFavoritesTable");
         for(var i = displayTable.rows.length - 1; i > 0; i--)
                displayTable.deleteRow(i);
       var fieldToLookFor = "MyFavorite";
         var ctx = new SP.ClientContext.get_current();
         var web = ctx.get_site().openWeb("/legal");
         var lists = web.get_lists();
         ctx.load(web);
         ctx.load(lists, 'Include(Title,Fields)');
         ctx.executeQueryAsync(Function.createDelegate(this, function(){
         var matchingLists = [];
         var listEnum = lists.getEnumerator();
         while(listEnum.moveNext()){
              var currList = listEnum.get_current();
              var containsField = false;
              var fields = currList.get_fields();
              var fieldEnum = fields.getEnumerator();
              while(fieldEnum.moveNext()){
                   if(fieldEnum.get_current().get_staticName() == fieldToLookFor){ containsField = true; break;}
              if(containsField){
                  matchingLists.push(currList.get_title());            
         //alert(matchingLists);
         var i = 0;
         while(i < matchingLists.length){
              var list = lists.getByTitle(matchingLists[i]);
              i++;
              var camlQuery = new SP.CamlQuery();
              var camlString = '<View><Query><FieldRef Name=\'' + fieldToLookFor + '\' /><Value Type=\'Integer\'>1</Value></Query></View>';
              camlQuery.set_viewXml(camlString);
              var items = list.getItems(camlQuery);
              ctx.load(items);
              ctx.executeQueryAsync(Function.createDelegate(this,function(){
                   var itemEnum = items.getEnumerator();
                   while(itemEnum.moveNext()){
                        var item = itemEnum.get_current();
                        var file = item.get_file();
                        ctx.load(file);
                        ctx.executeQueryAsync(Function.createDelegate(this,function(){
                        var table = document.getElementById("myFavoritesTable");
    // Create an empty <tr> element and add it to the 1st position of the table:
    var row = table.insertRow(-1);
    // Insert new cells (<td> elements) at the 1st and 2nd position of the "new" <tr> element:
    var cell1 = row.insertCell(0);
    var cell2 = row.insertCell(1);
    var cell3 = row.insertCell(2);
    var cell4 = row.insertCell(3);
    cell1.innerHTML = "XX";
    cell2.innerHTML = item.get_id();
    cell3.innerHTML = "<a href='" + item.get_file().get_serverRelativeUrl() + "' alt=''>" + item.get_file().get_name() + "</a>" ;
    cell4.innerHTML = "";
                     }),Function.createDelegate(this,function(sender, args){
                  alert(args.get_message());
              }),Function.createDelegate(this,function(sender, args){
                  alert(args.get_message());
    }), Function.createDelegate(this, function(sender, args){ 
         alert(args.get_message()); 
    </script>​​​​​ 
    <table id="myFavoritesTable">
       <tbody> 
          <tr valign="top" class="ms-viewheadertr"> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">שם טבלה 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">ID 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">כותרת 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">מסמך ​ 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> ​​​​​​​</td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
          </tr>
       </tbody> 
    </table>​ 
    <p>​​​​​​​​​</p>

  • How to unzip files from my pc using my macbook

    I transfered some of my files over from my pc into my macbook and I was wondering how do you unzip them in my macbook?? What program am I suppose to use?

    Get Stuffit Expander.
    http://www.macosg.com/group/viewtopic.php?t=5659&highlight=stuffit+expander
    -Bmer
    Mac Owners Support Group
    Join Us @ MacOSG.com
    iTunes: MacOSG Podcast
     An Apple User Group 
    Disclaimer required by Apple Discussions Terms of Use: MacOSG - a non-profit Apple User Group - may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • How to get folders from your server using IMAP and push, 3G.

    After looking all over this forum looking for an answer, I found out on my own. here's how:
    Step 1: Login to your email server.
    - If you can, log into your email server via webmail. This ensures that you are in fact connected to your email server and your folders are being created. If your email server doesn't have webmail, then create the folders using whatever email app you have on your PC or Mac.
    Step 2: Creating the folders.
    - All the folders you want to have show up on your iphone must be created as sub-folders under your Inbox folder on the server. Here's what mine looks like for example.
    Mailbox
    -Inbox
    ++-Sent Messages
    ++-Deleted Messages
    ++-Friends
    ++-Work
    ++-Others
    -Drafts
    -Sent
    -Deleted
    -Junk Email
    *you may be wondering why I have 2 sent and Deleted folders. I have it set up so that the folders in the inbox are for the iphone, and the ones outside are from Outlook.
    Step 3: Getting the folders to show up on the iphone.
    - Once you set up your IMAP account on the iphone 3g, simply log into the account, wait for it to finish checking for emails, then tap the Inbox button. Give it a few seconds to load if it's loading something. After it finishes, back out by tapping the 'Mailboxes' in the top-left corner, and your folders should be there.

    So you'd use Java to send the WebDAV protocol. Since this is a Java forum, it would help if you provided the WebDAV part of the equation and we can help with the Java part. Okay? Let us know when you have the WebDAV information.

  • How to keep files from disappearing when using Dynamic link to AE from PremProCS4?

    I am at my wits end here and hope someone can offer a solution.  I use Dynamic Link in PremProCS4 to link a clip in my timeline to AfterEffects.  I follow the instructions in my book and everytime I close my files and reopen..I loose the clip along with the effects...I get the place card instead.  Here are the steps I do as per the Adobe Classroom in a Book Explains:
    I double click on my .MTS file in the Project Board so it comes up on my Source Screen.
    I take select the part of the clip I wish to use in my timeline and drag it to the appropriate spot on a video layer.
    I then right click the "clip" and select "Replace With After Effects Comp"
    I then name the new file.  name or whatever.aep
    It opens in AE
    I then apply two simple effects... keying and a cartooning effect I use from NewBlue Cartooner.
    As instructed I then go directly back to PremPro and do a "render" by pressing the Enter Key.  This does not work since I only get a yellow bar above the clip instead of a red on???
    So then I save the PremPro project and close it then go to the AE project, save and close it.
    When I reopen PremPro the file has a place card in it and in AE it says I am missing a file.
    I have tried many different ways to do this process including re-importing the .MTS file.
    I can close PremPro and reopen it and all is the same as long as I don't close the AfterEffects project.  Once AE is closed it looses the file.  On a note here I keep all my computer source files in the same place and it never changes plus they are in my PPro Project as well.  I never change the names so this isn't this reason.
    Is there a tried and true method to select a piece of clip in the video layer in Prem Pro and add effects from AE and not have it misplace the files?
    Thanks  Kate

    Hi Mylenium, and thank you for taking the time to respond.
    Your idea of renaming comps got me to thinking..hmm.
    So I went back with a fresh mind this morning and tried something else..and it worked...so far anyway.
    So far I figured it out... 
    Since the normal process to do this doesn't work for me ..and apparently many others..here is the solution for those of you having similar issues.
    In PremPro select the desired clip you wish to place effects on
    Rename it and save
    R click and "Replace with AE composition"
    Name new file
    You will see three files pop up in AE in the project panel.
    The original source clip .. in my case.. shows an icon that lets me know it isn't the true file.
    Highlight this file with a click and then go Ctrl H (for PCs)
    The group of computer source clips you use for your project will come up.. double click on the original clip you had imported into your PPro project.
    The source file icon in AE will change to an icon that denotes the true file...save
    Go to your still open Ppro project and make sure it carried the effects over..save.
    Now you can save and close the AE project.
    So for this works for me today and I hope this helps anyone else dealing with a similar issue.
    Thanks.

Maybe you are looking for

  • Slow query with a lot of Nav attr and filter with them,what can i do

    Hi Gurus, my problem is this and the reason why i m asking: i got a query that the 80% of the char that show in the query are Nav Attr of an Infoobject "A",  and i filter for some Attr Nav, this IO its like to say Invoice Number, but this "invoice nu

  • Language field is not maintained in the source system

    hi, I had problem with 0ehs_actn_text data source. when i'm trying to pull data to BW it's saying language field is not maintained in the source system. I check the datasource there is no language field in the extract structure. and No fileds are che

  • Passing Information to a Method or a constructor

    Hi henry, yawmark, Darry Buke, all My last posting was a question. This i forgot to put question mark. Please look into it. I am ready to repeat it if you have any confusion. Hi henry I am satisfied with your answer which has been illustrated in your

  • RFC AUTHORIZATION FOR HRMD_ABA

    Hi all, We're loading information from a HR system into an e-Recruiting system using ALE connection based on HRMD_ABA message model. After processing IDocs, HR systems tells that we have no authorization for posting HRMD_ABA messages into e-Recruitin

  • SOAP Service not loaded: WSDL Exception

    MII: 12.0.3 OS: Win2k3 64bit JDK: 1.4.2_18 Trying to load a web service and i keep getting this error which i'm having a hard time finding out the problem. SOAP service could not be loaded. WSDLException (at /Rowsets): faultCode=INVALID_WSDL: Expecte