Skip to content

CreateFile, PutFile not working #215

@Leoudayan

Description

@Leoudayan

Hi,

The CreateFile and PutFile methods are not working. I am using CDN in my html page. Following is my code,

` async function writef() {

  const auth = solid.auth
  const fc   = new SolidFileClient(auth)
  const URL = "https://manoharan.solidcommunity.net/public"
  const FILE = "Sample Text"
  const TYPE1 = "plain/text"
  const TYPE2 = "text/turtle"

   try {
    //read a file
    //let content = await fc.readFile( 'https://manoharan.solidcommunity.net/favicon.ico' )
    //console.log(content)

    //create a folder
    //let createfolder = await fc.createFolder("https://manoharan.solidcommunity.net/public/Folder2/Folder1")
    //console.log(createfolder)
    
    //read a folder
    let readfolder = await fc.readFolder( "https://manoharan.solidcommunity.net/public" )
    console.log(readfolder)

    // create a file not working
    let writintfile = await fc.createFile(URL, FILE, TYPE1 )
    console.log(writintfile)

    //post a file not working
    let postfile = await fc.putFile(URL, FILE, TYPE2)
    console.log(postfile)
}
catch(error) {
    console.log( error )         // A full error response 
    console.log( error.status )  // Just the status code of the error
    console.log( error.message ) // Just the status code and statusText
}
  

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions