I know this has been asked before, but none of the answers were really appropriate in my case.
I have a support ticket system and want to allow users to be able to upload attachments to this. For this I'm using Fine Uploader.
My problem is
- Implementation
- Making it actually work
So:
What's the best way to do this? I was going to allow the user to select files and upload them with the form, which to me seemed most efficient. Some people suggested the option of automatically uploading files and then returning an ID to reference the attachment with each ticket reply. What's the best method to do this? I guess the first is most practical, also doesn't mean files are uploaded that aren't associated with replies. Second I guess makes it faster to submit a reply as the attachments are uploaded while you're typing and whatnot and you can see the progress of the upload. Best method?
I tried the first method, here was my code:
Form:
{{ Form::open(['route' => ['ticket', $ticket->id], 'method' => 'put', 'id' => 'qqform']) }}
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="control-label bold-label">Message</label>
<textarea name="message" id="message" placeholder="Message" rows="5"
class="form-control"></textarea>
</div>
</div>
</div>
<div id="reply-form-uploader" class="reply-form-uploader"></div>
<div class="text-right">
<button class="btn btn-info" type="submit">Submit</button>
</div>
{{ Form::close() }}
JS:
var uploader = new qq.FineUploader({
element: document.getElementById('reply-form-uploader'),
autoUpload: false,
interceptSubmit: true,
sizeError: 2048
The endpoint, according to the documentation, is the same as the URL for the action, the method I suppose is automatically set to POST as well and there is a _method var stating PUT to make that part work.
The problem here is that it doesn't work I add my attachment here But it doesn't appear anywhere in the request
Would appreciate some assistance :)