MegaApiClient icon indicating copy to clipboard operation
MegaApiClient copied to clipboard

GetDownloadLink not working. No option to get the share link.

Open ghost opened this issue 1 year ago • 2 comments

Description: I have a program to upload photos from my pc to a folder and i wanna make the folder publicly visible, i need the share link of the folder.

what are you trying to do I am trying to get the GetDownloadLink and it does not work. Tried GetDownloadLinkAsync too..

Actual Behavior: From my log, i see that it starts the process to get the link but it never continues and is stuck on the client.GetDownloadLinkAsync part.

what happens It created a new folder, It uploads the needed images when i do this: Uri downloadLink = await Task.Run(() => client.GetDownloadLinkAsync(node)); it stops there, i tried everything,

Expected Behavior: it should return the link so i could share it with whoever i want to

what should happen I believe the issue is related to the megaapiclient, since I've tried every single thing i could think of, asked chat-gpt too and it couldn't provide me a solution.

Steps to Reproduce:

  1. var remoteFolder = await CreateFolderWithRetryAsync(client, localFolderPath); //works as it should
  2. Uri link = await client.GetDownloadLinkAsync(remoteFolder); or if i use: Uri link = client.GetDownloadLink(remoteFolder); my windows forms app gets unresponsive, and never works again.

I have attached an image from my log

MegaApiClient Version: 1.10.4

image

ghost avatar Jul 08 '24 16:07 ghost

any thing for that problem i am using in unity as a nuget

await client.DownloadFileAsync(fileNode, downloadPath); //this is working
await client.GetDownloadLinkAsync(fileNode); //this is giving following error
ApiException: API response: AccessDenied
CG.Web.MegaApiClient.MegaApiClient.RequestCore[TResponse] (CG.Web.MegaApiClient.Serialization.RequestBase request, System.Byte[] key) (at <f7f948850b5c40809d4e684707ecfb10>:0)
CG.Web.MegaApiClient.MegaApiClient.Request[TResponse] (CG.Web.MegaApiClient.Serialization.RequestBase request, System.Byte[] key) (at <f7f948850b5c40809d4e684707ecfb10>:0)
CG.Web.MegaApiClient.MegaApiClient.GetDownloadLink (CG.Web.MegaApiClient.INode node) (at <f7f948850b5c40809d4e684707ecfb10>:0)
CG.Web.MegaApiClient.MegaApiClient+<>c__DisplayClass77_0.<GetDownloadLinkAsync>b__0 () (at <f7f948850b5c40809d4e684707ecfb10>:0)
System.Threading.Tasks.Task`1[TResult].InnerInvoke () (at <51fded79cd284d4d911c5949aff4cb21>:0)
System.Threading.Tasks.Task.Execute () (at <51fded79cd284d4d911c5949aff4cb21>:0)
--- End of stack trace from previous location where exception was thrown ---
MegaStreamVideoPlayer.Start () (at Assets/Red Pool/Mega VideoPlayer/MegaStreamVideoPlayer.cs:30)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <51fded79cd284d4d911c5949aff4cb21>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <f1e29a71158e46cdb750140a667aea01>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <f1e29a71158e46cdb750140a667aea01>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <f1e29a71158e46cdb750140a667aea01>:0)

fawad0dev avatar Aug 12 '24 07:08 fawad0dev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 20 '25 03:07 stale[bot]