GithubHelp home page GithubHelp logo

Comments (5)

mOrfiUs avatar mOrfiUs commented on August 23, 2024

I use GetDoenloadLink in this routine and works fine.
dll .Net 4.0 (32 and 64 because i hve two diff servers)

`
List events = new List();
Parallel.ForEach(lToUp, new ParallelOptions { MaxDegreeOfParallelism = LoA.iSimultaneousUp }, f =>
{
MegaApiClient cMegaForEach = new MegaApiClient();
try
{
cMegaForEach.Login(LoA.userMega, LoA.passMega);
Stopwatch dur = new Stopwatch();
dur.Start();

                string l = string.Empty;
                using (var streamUp = new FileStream(f, FileMode.Open, FileAccess.Read))
                    l = cMegaForEach.GetDownloadLink(cMegaForEach.Upload(streamUp, f, LoA.nodeBkUpFolder)).ToString();

                if (!string.IsNullOrEmpty(l))
                    if (LoA.bCheckSHA1 == 1)
                    {
                        ManualResetEvent mre = new ManualResetEvent(false);
                        ThreadPool.QueueUserWorkItem (
                            delegate(object o)
                            {
                                checkSha1File(LoA, l);
                                ((ManualResetEvent)o).Set();
                            }, mre);
                        events.Add(mre);
                    }
                string sR = new util().sizeReadable(new FileInfo(f).Length / dur.Elapsed.TotalSeconds) + "/s";
                dur.Stop();
                lOk.Add(new string[4] { DateTime.Now.ToString("HH:mm:ss"), f, sR, l });
            }
            catch (Exception ex)
            {
                lErr.Add(new string[3] { DateTime.Now.ToString("HH:mm:ss"), f, ex.Message });
            }
        });

`

from megaapiclient.

gpailler avatar gpailler commented on August 23, 2024

@ArchonDeveloper Could you attach a minimal code to reproduce your issue?

from megaapiclient.

ArchonDeveloper avatar ArchonDeveloper commented on August 23, 2024

Actually my code is simple:
var foundNode = _currentNodes.FirstOrDefault(item => item.Name == imageGuid);
var p = _currentClient.GetDownloadLink(foundNode);

But foundNode is a folder and not a file. Could it be the issue?
Also I found that mega sends next message [{"a":"l","n":"PgEwUYhJ","i":"eAZpKfOp2x"}]. And message from your code is without "i" argument like [{"a":"l","n":"PgEwUYhJ"}]. When I'm trying to send request(via Fiddler in composer) without "i", I'm getting the same code error (-11).

Thanks for trying to help me.

from megaapiclient.

gpailler avatar gpailler commented on August 23, 2024

Thanks for the details. You're probably right, GetDownloadLink method should work only with files. I will add support for folders

from megaapiclient.

ArchonDeveloper avatar ArchonDeveloper commented on August 23, 2024

Thanks for that. Will wait on new release ;)

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.