Skip to content

Commit 506b697

Browse files
committed
Fix file_name extraction in Assets model
1 parent 7b7fa1f commit 506b697

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llmstack/assets/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def create_from_url(cls, url, metadata={}, ref_id=""):
4848
return None
4949

5050
# Get the filename and mime type from the response headers
51-
file_name = url.split("://")[-1].split("?")[0]
51+
file_name = url.split("://")[-1].split("?")[0].split("/")[-1]
5252
content_disposition = response.headers.get("content-disposition", "")
5353
content_disposition_split = content_disposition.split("filename=")
5454
if content_disposition_split and len(content_disposition_split) > 1:

0 commit comments

Comments
 (0)