hugodias / fileupload Goto Github PK
View Code? Open in Web Editor NEWJquery File Upload for CakePHP 2.x
Jquery File Upload for CakePHP 2.x
I know you're dealing with $_FILES at the moment, was wondering if there's any intention for the PUT HTTP verb?
Michael
I've found a small issue in the UploadComponent on line 27.
You've got:
$this->UploadModel = ClassRegistry::init('Upload');
but because it's a plugin, you're not loading the Upload model within your plugin but the default AppModel of the application you're running. Changes made in the plugins Upload model will be useless because that's not the model you're using.
Change it to:
$this->UploadModel = ClassRegistry::init('FileUpload.Upload');
In this case you are using the Upload model inside the plugin so changes (like $useTable) will have it's effects when you want it to.
How would I go about using this say if I have baked Products
so in /app/View/Products/add.ctp
Essentially I want to be able to upload images specific to this product.
(as standalone form the plugin works just fine like domain.com/file_upload)
Thanks
When i tried to upload a file i got and Error = Internal Server Error.
I already give access to write to the App/Webroot/Files directory.
Any Ideas ?
I am using your plugin and everything works great in FF, Chrome, etc. When I try to upload a file using IE8, I get an error response saying empty file upload. When I check my folder, the file was successfully uploaded, and when I refresh my browser, the file is there. The error happens just immediately after it uploads the file and tries to send back the file information to the browser.
Hi, I am trying to use this pluging, but when I try to access the start controller I receive this message:
Fatal error: Call to a member function allow() on a non-object in /Users/alexleandro/Sites/picstik/app/Plugin/FileUpload/Controller/FileUploadController.php on line 6
I try to call http://localhost:8888/picstik/file_upload
What could be?
2013-09-03 13:30:27 Error: [MissingActionException] Action AppController::webroot() could not be found.
Exception Attributes: array (
'controller' => 'AppController',
'action' => 'webroot',
)
Request URL: /cakecms/app/webroot/thumb/p7.png
Stack Trace:
#0 D:\XAMP\htdocs\cakecms\lib\Cake\Routing\Dispatcher.php(187): Controller->invokeAction(Object(CakeRequest))
#1 D:\XAMP\htdocs\cakecms\lib\Cake\Routing\Dispatcher.php(162): Dispatcher->_invoke(Object(AppController), Object(CakeRequest), Object(CakeResponse))
#2 D:\XAMP\htdocs\cakecms\app\webroot\index.php(110): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#3 {main}
I have successfully added a simple javascript confirm on the file delete button, but when I press cancel it deletes the file anyway. Is there any other way I can get this to work?
thankyou for ur plugin..
i have downloaded your cakephp-JqueryFileUpload. buttons are displaying correctly.
If i add the file, the file is not displaying.. i used the plugin in my previous cakephp project...
please help me.., why the file list is not displaying..?
I had to disable CakePHP Security csrfCheck to allow photo to be uploaded.
After clicking Add File and selecting photo, the photo thumbnail showed, but I got "Error Bad Request" inline error message. The CakePHP error log showed the action was blackholed indicating 'csrf'.
A check CakePHP docn http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html indicated i needed to disable the Security for this operation using $this->Security->csrfCheck = false;
This was put in the beforeFilter() of HandlerController as follows:
function beforeFilter(){
parent::beforeFilter();
$this->Auth->allow("*");
$this->Security->csrfCheck = false;
}
Hi, i was wondering if its possible to assign the uploads in a category?
Not sure if this is the right place to leave this.
I editted the UploadFormHelper so that it would be more responsive and act more like Blueimp's design. The reason was that with Bootstrap enabled, the item table would extend past my mobile screen. The progress bar was also either very small or non-existant.
Here is the updated code:
private function _loadScripts()
{
echo '<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td class="preview"><span class="fade"></span></td>
<td>
<div class="name"><span>{%=file.name%}</span></div>
<div class="size"><span>{%=o.formatFileSize(file.size)%}</span></div>
{% if (file.error) { %}
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else if (o.files.valid && !i) { %}
<div>
<div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
</div>
</td>
<td>
<div class="start">{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary">
<i class="icon-upload icon-white"></i>
<span>{%=locale.fileupload.start%}</span>
</button>
{% } %}</div>
{% } else { %}
<td colspan="2"></td>
{% } %}
<div class="cancel">{% if (!i) { %}
<button class="btn btn-warning">
<i class="icon-ban-circle icon-white"></i>
<span>{%=locale.fileupload.cancel%}</span>
</button>
{% } %}</div>
</td>
</tr>
{% } %}
</script>
Basically changed the td to div and removed some code. Scales perfectly now.
Thanks to create plugin. Is there setting to create thumbnail too and max limit to file upload.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.