kartike
1 Copper

Couldn't find uploaded files in AtmosFox explorer

Hi,

I am using .net API to upload the files into cloud server.

I can define hostname,port,id, secretkey in code and and upload the file using following method.

            ObjectPath path = new ObjectPath("/karthik/UploadFiles/");

            string file = "C:/Users/karthike/Desktop/Element.docx";                                       

            ObjectId objectId = upload.CreateObjectOnPath(path,file, acl, null);

I can upload and get the sharable url and download the files.

But i couldn't find the uploaded files in the AtmosFox explorer, even i couldn't find the Objectpath. I mentioned same id and key for managed accounts and same end url in preference in AtmosFox explorer that i used in above code.

What i need to do to get the the uploaded files in Atmos Explorer?

Regards,

Karthik.

Labels (1)
0 Kudos
3 Replies
JasonCwik
3 Argentium

Re: Couldn't find uploaded files in AtmosFox explorer

Karthik,

In Atmos, ObjectPaths that end with a slash are directories, and the upload helper requires the exact destination path, not the directory you want the file to be placed in.  Therefore, the code should be:

            ObjectPath path = new ObjectPath("/karthik/UploadFiles/Element.docx");

            string file = "C:/Users/karthike/Desktop/Element.docx";                                       

            ObjectId objectId = upload.CreateObjectOnPath(path,file, acl, null);

0 Kudos
Highlighted
mirando
1 Copper

Re: Couldn't find uploaded files in AtmosFox explorer

Why does an Object path get asserted as a directory path (using esuPHP) even if the path is invalid?

$dirPath = new ObjectPath('/syntacticallyvalidbutnonexistentdirectory/');




if ($dirPath->isDirectory()) {



echo 'Home directory  exists!<br>';



print_r($dirPath);



} else {



echo 'Home directory does not exist!';



}

Looking at EsuObjects.php it looks like it doesn't verify if the path actually exists, just if the ObjectPath looks to be valid syntax for a directory path.

0 Kudos
JasonCwik
3 Argentium

Re: Couldn't find uploaded files in AtmosFox explorer

That's correct; the ObjectPath->isDirectory() method simply checks the syntax of path to see if it's a directory.  This is to keep all operations that involve network access constrained to the EsuRestApi object, preventing objects from having methods that create "hidden" network access to Atmos.  To check whether a directory really exists, you'll need to perform some operation such as getSystemMetadata() on it.  If it does not exist, an EsuException will be thrown with code 1003 (the requested object was not found).

0 Kudos