Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom MimeType not working #69

Open
CarterVE opened this issue Jul 4, 2023 · 9 comments
Open

Custom MimeType not working #69

CarterVE opened this issue Jul 4, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@CarterVE
Copy link

CarterVE commented Jul 4, 2023

I'm not sure if I'm doing something wrong, but I can't get the custom MimeType to work on iOS. Is this supported/if so are there specific things I need to do to get a file with a custom MimeType to export? I am using the MimeType.custom with my own MimeType string, and even specified the export type in XCode.

Thanks!

@incrediblezayed
Copy link
Owner

Hey, can you share your code?

@incrediblezayed incrediblezayed self-assigned this Jul 4, 2023
@incrediblezayed incrediblezayed added the bug Something isn't working label Jul 4, 2023
@CarterVE
Copy link
Author

CarterVE commented Jul 4, 2023

I can't share my exact code, but generally I use:

await FileSaver.instance.saveAs(
  name: name,
  bytes: data,
  ext: "xyz",
  mimeType: MimeType.custom,
  customMimeType: "application/exampleName"
);

@CarterVE
Copy link
Author

CarterVE commented Jul 4, 2023

Hopefully that's useful? I'm not sure if the customMimeType String needs to follow a specific pattern or something

@incrediblezayed
Copy link
Owner

As per your code, you are correct, but can you atleast tell me the mimeType which you are using? and is it working fine on android?

@CarterVE
Copy link
Author

CarterVE commented Jul 4, 2023

I'm not sure if it's working correctly on Android either, I can test that now. I'm trying to create a truly custom MimeType, so it's not one that currently exists, but the file itself is a JSON that is compressed using LZString (with a custom extension). Does it need to be a public MimeType? I'm pretty sure it should conform to public.content/public.data if that matters

@CarterVE
Copy link
Author

CarterVE commented Jul 4, 2023

As far as I can tell it's not working on Android either, for both when I export the file and check using file -b --mime-type <FILE-NAME> it says the MimeType is application/octet-stream (which as I understand it means the MimeType is unknown)

@incrediblezayed
Copy link
Owner

I'm not sure if it needs to be a public mimeType, I'll check on some random mimeType and get back to you tomorrow, if possible can you join discord and remind me tomorrow? I'm working on something urgent right now.

@CarterVE
Copy link
Author

CarterVE commented Jul 4, 2023

Absolutely this is not urgent, tomorrow is great!

@incrediblezayed
Copy link
Owner

Thank You so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants