locked
Creating file at random location windows store c# RRS feed

  • Question

  • Hello,

    Is there any way to store the file at the desired location given by the user.

    suppose If user open file using fileopenpicker and now he wants to store the file in the same folder , so how to provide that path to StorageFile Api. 

    Friday, January 31, 2014 1:04 PM

Answers

  • This API allows you to create a file using a different name via the CreationCollisionOption parameter:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.createfileasync.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by zee_patel Monday, February 3, 2014 5:15 AM
    Friday, January 31, 2014 2:01 PM
    Moderator

All replies

  • I have to ask:  are you encountering a problem when you try to store the file in the folder provided by the user?


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, January 31, 2014 1:32 PM
    Moderator
  • Hello matt,

    Scenario is that ,once the user open a  file, after editing that file when he/she clicks on save button new file should be generated at the same location folder from which the file was opened without overwriting the opened file.


    • Edited by zee_patel Friday, January 31, 2014 1:41 PM
    Friday, January 31, 2014 1:40 PM
  • This API allows you to create a file using a different name via the CreationCollisionOption parameter:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.createfileasync.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by zee_patel Monday, February 3, 2014 5:15 AM
    Friday, January 31, 2014 2:01 PM
    Moderator