Some general advice:

  1. Root directory should be a configurable setting,
    • Before changing config, call NormalizeDirectory method of %File class
    • Check that directory exists and you can write to it
    • If it's Ensemble check that Ensemble can write to that directory too
  2. Try to minimize the number of root directories, if you have to have several. It's preferable to use subdirectories.
  3. Calculate all subdirectories via calls to SubDirectoryName method from %File class
  4. You should not have slash symbols for directories/files purposes in your code base.

Looks like there's a character stream somewhere. You should always use binary streams to upload binary data such as images, PDFs and so on.

First of all you need to understand where the problem is: on sending or on receiving.

To do that upload PDF using your BO and download it from AWS website manually (using your browser). If you can open downloaded file, then it means that your upload code is correct and the problem is with download code. If you can't open the file it means that you need to check upload code.

In the future please don't combine separate questions into one post.

I am looking for a way to detimerine if a certain namespace is ensemble enabled.

To check that some <namespace> has Ensemble enabled call:

write ##class(%EnsembleMgr).IsEnsembleNamespace(<namespace>)

where <namespace> defaults to current namespace.

Log some information to the console log file with a certain error level.

%SYS.System class provides the WriteToConsoleLog method, which you can use to write to the cconsole.log file.

- If I have a global available in a certain namespace, can I use InterSystems SQL to query those globals?  

- How do existing globals and creating classes work?  Like I have a Person global right now.  Can I turn that into a class and manipulate the data that way?

You'll need class mapping to query globals via SQL. Check article series  The Art of Mapping Globals to Classes by @Brendan Bannon.

- I'm used to Java where you can write a class and then write a driver class to test your classes and methods. Or simply just test your newly created classes and methods in the main method (wherever that lies in your code).  Is there something similar in Studio?  I can write classes but then they are compiled and I have to go to the terminal and test them?  Is this where routines come into play in Studio?

You can configure Studio or Atelier debugger to run any class method. There's no need to use routines for that.