diff --git a/src/backend/langflow/api/endpoints.py b/src/backend/langflow/api/endpoints.py index 2d4e96abf..d01d18064 100644 --- a/src/backend/langflow/api/endpoints.py +++ b/src/backend/langflow/api/endpoints.py @@ -43,7 +43,7 @@ async def create_upload_file(file: UploadFile, client_id: str): # Cache file file_path = save_uploaded_file(file.file, file_name=client_id) - return {"filename": file_path} + return {"file_path": file_path} # get endpoint to return version of langflow diff --git a/src/frontend/src/components/inputFileComponent/index.tsx b/src/frontend/src/components/inputFileComponent/index.tsx index 89969fc06..e6e9c9e33 100644 --- a/src/frontend/src/components/inputFileComponent/index.tsx +++ b/src/frontend/src/components/inputFileComponent/index.tsx @@ -59,15 +59,15 @@ export default function InputFileComponent({ .then((data) => { console.log("File uploaded successfully"); // Get the file name from the response - const { filename } = data; - console.log("File name:", filename); + const { file_path } = data; + console.log("File name:", file_path); // Update the state and callback with the name of the file // sets the value to the user setMyValue(file.name); onChange(file.name); // sets the value that goes to the backend - onFileChange(filename); + onFileChange(file_path); }) .catch(() => { console.error("Error occurred while uploading file");