Skip to content

QUESTION: What is the way to properly upload a file? #152

@jordi-z80

Description

@jordi-z80

I'm trying to upload a file to Replicate to do img2img but no matter what I do, I'm always getting a 500 internal server error.

The code is quite straightforward, so unless I have to use a "magic string" on the second parameter, I have no idea how to proceed.


		byte []data = await File.ReadAllBytesAsync (fn);

		FilesCreateRequest req = new FilesCreateRequest (data, "content", "z.png", null, null);
		var response = await api.FilesCreateAsync (req);

The ApiKey is correct, otherwise I'd be getting a 401.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions