0

Is there something wrong with my load method? It seems fine and looks correct compared to code others have posted on Stack. What is happening is the main page displays correctly. When I navigate to any other pages my web-browser doesn't redirect me to the page but instead, it asks me if I want to download it. What is going wrong here?

BYTE* data = malloc(sizeof(BYTES)*INT_MAX);
if (data == NULL) {
    return false;
}

int totalBytes = 0;
// read file
for (int i = fgetc(file); i != EOF; i = fgetc(file)) {
    data[totalBytes] = (char)i;
    totalBytes++;
}

*content = data;
*length = totalBytes;
// printf("Data: \n%s\n", *content);
// printf("Length: %zu\n", *length);
return true;
1

Browser will offer download if MIME type is unknown. Verify lookup conforms to spec. Typo's in lookup often cause this result.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .