we can just directly upload files without needing to enter any other fields: https://esygv-biaaa-aaaak-ak2va-cai.icp0.io/
in conosle can check the uploaded file link , but its not showing the file
The console shows to me (besides a bunch of websocket errors) https://unuoe-3aaaa-aaaai-q3nda-cai.icp0.iofile-Screenshot as a malformed link to the screenshot. If I fix it to https://unuoe-3aaaa-aaaai-q3nda-cai.icp0.io/file-Screenshot I get the error
Replica Error: reject code CanisterError, message IC0503: Error from Canister unuoe-3aaaa-aaaai-q3nda-cai: Canister called `ic0.trap` with message: Panicked at 'Cannot use Func directly. Use `define_function!` macro instead.', /Users/veerpratap/.cargo/registry/src/index.crates.io-6f17d22bba15001f/candid-0.10.10/src/types/reference.rs:83:9.
Consider gracefully handling failures from this canister or altering the canister to handle exceptions. See documentation: http://internetcomputer.org/docs/current/references/execution-errors#trapped-explicitly, error code Some("IC0503")
Looks like you’re not properly registering some of the canister interface.
i have made update to backend code as earlier i havent added teh logic for certification,
but still i ave some error on trying to access the file like :Response verification failed: Tree not found
for example i have uploaded the file and link generated is this: https://unuoe-3aaaa-aaaai-q3nda-cai.icp0.io/file-image-12.jpg
Your certificate does not contain everything it needs. AFAIU you only serialize the cert, nothing else. Here’s how the asset canister does it. You can read more about certification here
Invalid response body does not refer to the HttpResponse struct types. @NathanosDev, could this error message be improved?
The error gets returned if this function returns false. So it means that your response’s hash did not appear in the certificate tree in the expected place
When you got to that link, the browser requests /file-image-79.jpg, not file-image-79.jpg. If you try the version with / in Candid UI you get the same failure
Yes, this is a complete example for certifying assets. This example is much simpler and does the same thing, but it uses an unreleased library. If you can wait some days then that library will be released very soon.