Comments (5)
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.
@ArchonDeveloper Could you attach a minimal code to reproduce your issue?
from megaapiclient.
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.
Thanks for the details. You're probably right, GetDownloadLink method should work only with files. I will add support for folders
from megaapiclient.
Thanks for that. Will wait on new release ;)
from megaapiclient.
Related Issues (20)
- Problem accessing MEGA API account HOT 3
- Add ability to attach thumbnails to image uploads HOT 1
- Possible To Get Progress On Get Nodes HOT 1
- Add sample to show how to retrieve folder contents recursively from parent folder
- publicly available node AccessDenied, when get info about node HOT 4
- How can I implement functions to collect more metadata?
- Unable to get download link for directory node HOT 2
- Contacts and shared folders support? Usage of owner IDs? Errors with attribute deserialization! HOT 1
- Resolving MEGA Account Blocking Issue When Uploading Files HOT 2
- MegaApiClient error when building Console App to native code HOT 1
- CG.Web.MegaApiClient.MegaApiClient.Login > Unable to cast object of type 'System.Int64' to type 'Newtonsoft.Json.Linq.JArray' HOT 3
- Problem with LoginAnonymous()
- What is the difference between `Task.Delay(retryDelay).Wait()` and `Thread.Sleep(retryDelay)` HOT 3
- Unable to load nodes due to too much memory consumption. HOT 4
- Attribute deserialization failed: Unexpected character encountered while parsing value: HOT 1
- Not returning new created folders HOT 4
- MegaApiClient is now in passive maintenance mode HOT 1
- Name is coming as NULL for files uploaded using 'CreateFileRequest'
- Erro DeleteAsync HOT 1
- GetDownloadLink not working. No option to get the share link. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from megaapiclient.