Not getting items from Appwrite Storage. #62782
Unanswered
surjeet88
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a route.js file import { IFetchResponse, IFileData } from "@/types/types";
import { NextResponse } from "next/server";
export async function GET(){
const response = await fetch('https://cloud.appwrite.io/v1/storage/buckets/65d60da739219adc60eb/files', {
headers: {
'X-Appwrite-Project': '65d5fae96d83b9aa3bfe',
'Content-Type': 'application/json',
},
// next: { revalidate: 1}
I get
Which is a single file but infact i have two files
The post man response with the same endpoint is
{
"total": 2,
"files": [
{
"$id": "65dd787c23607504be0c",
"bucketId": "65d60da739219adc60eb",
"$createdAt": "2024-02-27T05:51:56.449+00:00",
"$updatedAt": "2024-02-27T05:51:56.449+00:00",
"$permissions": [
"read("user:65cc6c71465df58985ba")",
"update("user:65cc6c71465df58985ba")",
"delete("user:65cc6c71465df58985ba")"
],
"name": "pat-taylor-12V36G17IbQ-unsplash.jpg",
"signature": "4b2cf4435d3e17345a24468d6f03a4c5",
"mimeType": "image/jpeg",
"sizeOriginal": 821038,
"chunksTotal": 1,
"chunksUploaded": 1
},
{
"$id": "65e1787187712fbab6f0",
"bucketId": "65d60da739219adc60eb",
"$createdAt": "2024-03-01T06:40:49.853+00:00",
"$updatedAt": "2024-03-01T06:40:49.853+00:00",
"$permissions": [
"read("user:65cc6c71465df58985ba")",
"update("user:65cc6c71465df58985ba")",
"delete("user:65cc6c71465df58985ba")"
],
"name": "dumbbells-2465478_640.jpg",
"signature": "7d2f2cdc5e31f9c0d9696faffe304fa5",
"mimeType": "image/jpeg",
"sizeOriginal": 90883,
"chunksTotal": 1,
"chunksUploaded": 1
}
]
}Which is giving me both the files.Could you pls suggest me a solution?
Beta Was this translation helpful? Give feedback.
All reactions