Trying to work with a web page to upload files and update a certain document

I am trying to create a web form and make a call to a server script.
I am able to update basic field types,

But i have attachments i am working with, and i dont know how to upload.

There are 2 issues, i am not able to log what is on the server script. I am using frappe cloud to host the service.

The second issue is i am not able to access files when making