Skip to content

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

Closed

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.

Activity

  1. jordi-z80 commented on Mar 3, 2026

    @jordi-z80
    Author

    I think it's a problem on dotnet's side. Closing.

    dotnet/runtime#121484

    EDIT:

    Actually after too much searching, I found that although the RFC 7578 example puts the value with quotes, those quotes are actually not required by the standard, so it's Replicate's server bug? Anyways, not a bug in this repo.

  2. added a commit that references this issue on Mar 3, 2026
    22e7329
  3. HavenDV commented on Mar 4, 2026

    @HavenDV
    Contributor

    I have released a manual fix and I'll plan to support it also on an AutoSDK level for all other SDKs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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