-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not returning new created folders #241
Comments
Hello, Could you provide a snippet of the code? The created folder appears in the list returned by |
Hi, tanks for the answer this is the test code, the code runs ok .. but after first call... the folder exists codes always return false because the folder created previously not return on nodes... var client = new MegaApiClient(); client.Login(Program.Parametros.GetSetting("Email"), Program.Parametros.GetSetting("Password")); var nodes = client.GetNodesAsync().Result; var root = nodes.Single(x => x.Type == NodeType.Root); nodes = client.GetNodes(root); IEnumerable onlineFolders = nodes.Where(x => x.Type == NodeType.Directory && x.ParentId == root.Id); INode myFolder; if (onlineFolders.Any(p => p.Name.ToLower() == Program.Parametros.GetSetting("OnlineFolder").ToLower())) var myFile = client.UploadFile(e.FullPath, myFolder); client.Logout(); |
I'm not sure to perfectly understand your scenario. You mean that the folder is not found when this snippet is called a second time? MegaApiClient client = new MegaApiClient();
client.Login(Program.Parametros.GetSetting("Email"), Program.Parametros.GetSetting("Password"));
INode[] nodes = client.GetNodes().ToArray();
INode root = nodes.Single(x => x.Type == NodeType.Root);
string folderName = Program.Parametros.GetSetting("OnlineFolder").ToLower();
Func<INode, bool> folderExists = x => x.Type == NodeType.Directory && x.ParentId == root.Id && x.Name == folderName;
// Search for the folder or create it
INode folderNode = nodes.FirstOrDefault(folderExists);
if (folderNode == null)
{
folderNode = client.CreateFolder(folderName, root);
}
// Retrieve the nodes again and search for the folder
nodes = client.GetNodes().ToArray();
if (nodes.Any(folderExists) == false)
{
throw new Exception("Folder not found");
}
client.Logout(); |
Hi, tks for the answer, i'm tested with your code block and tested with other folder name but in all cases the folder is created online but allways returning Folder Not Found... =/ |
I am using the component to perform file uploads. I am logging in, creating a folder, and uploading the files to folders. Everything is working perfectly. The folders and files created appear on the online platform correctly. However, minutes later, when I make a new access and retrieve the nodes, the folders I created do not appear in the list of nodes. On the online platform, even when I create a folder and then try to access it, it also does not appear in the nodes. Could someone help me with this issue?
MegaApiClient Version:1.10.4
The text was updated successfully, but these errors were encountered: