# Upload

In standalone mode, you can use the `upload` method to upload a file. This method takes in the the original file and the cover which is optional. Once the upload is complete, Larupload will automatically generate a unique filename and save the file to the specified path.

```php
<?php

namespace App\Http\Controllers;

use Mostafaznv\Larupload\Larupload;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class UploadController extends Controller
{
    public function store(Request $request): JsonResponse
    {
        $file = $request->file('file');
        $cover = $request->file('cover');
        
        $upload = Larupload::init('your/base/path')->upload($file, $cover);

        return response()->json($upload);
    }
}
```

{% code title="Output" %}

```json
{
    "original": "http://larupload.site/storage/uploader/original/a3ac7ddabb263c2d00b73e8177d15c8d.mp4",
    "meta": {
        "name": "a3ac7ddabb263c2d00b73e8177d15c8d.mp4",
        "id": "125940123",
        "original_name": "video.mp4",
        "size": 383631,
        "type": "video",
        "width": 560,
        "height": 320,
        "duration": 5,
        "format": "mp4",
        "cover": "66ad2a5ebfe7ea349c8b861399c060d8.jpeg",
        "mime_type": "video/mp4",
        "dominant_color": "#e5d2d4",
    }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mostafaznv.gitbook.io/larupload/standalone-uploader/upload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
