diff --git a/endpoints/libraries/web.app.localizer.js b/endpoints/libraries/web.app.localizer.js index 46c2d8f2..d3c6e5db 100644 --- a/endpoints/libraries/web.app.localizer.js +++ b/endpoints/libraries/web.app.localizer.js @@ -88,3 +88,4 @@ class WebAppLocalizer { }); } } +export default WebAppLocalizer; \ No newline at end of file diff --git a/endpoints/lollms_apps.py b/endpoints/lollms_apps.py index f6a70315..5a169a23 100644 --- a/endpoints/lollms_apps.py +++ b/endpoints/lollms_apps.py @@ -212,6 +212,17 @@ class AppNameInput(BaseModel): app_name: str +import tempfile + + +from fastapi.responses import FileResponse +import tempfile +import os + +from fastapi.responses import Response +from io import BytesIO +import zipfile + @router.post("/download_app") async def download_app(input_data: AppNameInput): check_access(lollmsElfServer, input_data.client_id) @@ -221,24 +232,33 @@ async def download_app(input_data: AppNameInput): if not app_path.exists(): raise HTTPException(status_code=404, detail="App not found") - # Create a BytesIO object to store the zip file - zip_buffer = io.BytesIO() + # Create a BytesIO object to store the zip file in memory + zip_buffer = BytesIO() - with zipfile.ZipFile(zip_buffer, 'w', zipfile.ZIP_DEFLATED) as zip_file: - for file in app_path.rglob('*'): - if file.is_file() and '.git' not in file.parts: - relative_path = file.relative_to(app_path) - zip_file.write(file, arcname=relative_path) + try: + with zipfile.ZipFile(zip_buffer, 'w', zipfile.ZIP_DEFLATED) as zip_file: + for file in app_path.rglob('*'): + if file.is_file() and '.git' not in file.parts: + relative_path = file.relative_to(app_path) + zip_file.write(file, arcname=str(relative_path)) - # Seek to the beginning of the BytesIO object - zip_buffer.seek(0) + # Move the cursor to the beginning of the BytesIO object + zip_buffer.seek(0) + + # Create a Response with the zip content + return Response( + content=zip_buffer.getvalue(), + media_type="application/zip", + headers={ + "Content-Disposition": f"attachment; filename={app_name}.zip", + "Cache-Control": "no-cache", + "Pragma": "no-cache", + "Expires": "0" + } + ) + except Exception as e: + raise HTTPException(status_code=500, detail=f"Error creating ZIP file: {str(e)}") - # Create a StreamingResponse to return the zip file - return StreamingResponse( - zip_buffer, - media_type="application/zip", - headers={"Content-Disposition": f"attachment; filename={app_name}.zip"} - ) @router.post("/upload_app") async def upload_app(client_id: str, file: UploadFile = File(...)): diff --git a/help/index.html b/help/index.html index 333dd544..d9ff0c49 100644 --- a/help/index.html +++ b/help/index.html @@ -35,54 +35,6 @@
-Welcome to the LoLLMs help documentation. Here you will find information and guides on how to use various features and functionalities of LoLLMs.
-LoLLMs (Lord of Large Language Multimodal Systems) is a versatile system designed to handle various tasks, including document summarization, code interpretation, and more. This documentation will guide you through the different features and how to use them effectively.
- -To get started with LoLLMs, you need to install and configure the system on your machine. Follow the installation guide provided in the documentation to set up LoLLMs.
- -LoLLMs supports various personalities that allow it to perform specific tasks. Below are some of the personalities available:
- -Learn how to perform contextual summarization of documents using the docs_zipper
personality.
Go to Document Summarization Help
- - - -Explore the advanced features of LoLLMs, including code interpretation, internet search integration, and more.
- -If you encounter any issues while using LoLLMs, refer to the troubleshooting section for solutions to common problems.
- -If you need further assistance, feel free to reach out to us:
-Email: parisneoai@gmail.com
-Twitter: @ParisNeo_AI
-Discord: Join our Discord
-Sub-Reddit: r/lollms
-Instagram: spacenerduino
-See ya!
-