GithubHelp home page GithubHelp logo

Comments (5)

gpailler avatar gpailler commented on August 23, 2024 2

You can use the following to get your file:

var nodes = megaApiClientInstance.GetNodes();
var root = nodes.Single(n.Type == NodeType.Root);
var level1 = megaApiClientInstance.GetNodes(root).Single(n => n.Type == NodeType.Folder && n.Name == "folder");
var level2 = megaApiClientInstance.GetNodes(level1).Single(n => n.Type == NodeType.Folder && n.Name == "somefolder");
var level3 = megaApiClientInstance.GetNodes(level2).Single(n => n.Type == NodeType.Folder && n.Name == "somefolder2");
var file = megaApiClientInstance.GetNode(level3).Single(n => n.Type == NodeType.File && n.Name == "somefile.file");

If your file has an unique name, another way is to request it directly

var file = megaApiClientInstance.GetNodes().Single(n => n.Type == NodeType.File && n.Name == "somefile.file");

(it works because mega.nz stores all files/folders in a flat list and GetNodes() methods returns all nodes.)

from megaapiclient.

gpailler avatar gpailler commented on August 23, 2024

I don't really understand your question. folder\somefolder\somefolder2\somefile.file is the storage path on your mega account?

from megaapiclient.

woramon avatar woramon commented on August 23, 2024

Yes it is but its In a different path for each user's mega account, not mine. Example:
user1 file path for download:string Path = folder\somefolder\somefolder2\somefile.file
user2 file path for download: string Path = folder2\somefolder2\somefile2.file
user3 ....

from megaapiclient.

woramon avatar woramon commented on August 23, 2024

The second worked. I didn't know this method works like this. I think You can fill wiki more. You can give information about how methods works and the usage . Thank you so much. You saved my life 👍

from megaapiclient.

gpailler avatar gpailler commented on August 23, 2024

😄 Feel free to contribute and add samples...

from megaapiclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.