Limit dropzone.js file upload - file-upload

I'm trying to limit the file uploads to allow uploading only 1 file. I'm pretty sure this has something to do with altering the selectedfiles callback, but haven't gotten it to work yet. Has anyone solved this?

Not sure if you're still looking for an answer, but you are correct, you need to add this.removeAllFiles(); under the selectedfiles callback.

Related

Typo3 and own script in FlexForms

Is it possible to use my own PHP in flexform?
I need to read data from a txt file that I upload in the same FlexForm.
I guess I need to reload the flexform after uploading, but how do I read the context of the txt file and list it in the Flexform?
You can use user type of field as described in TCA docs.
Unfortunately I haven't any sample now, but there should be not problem to implement what you need. Tip: good IDE with some debugger will be your friend :)
I made it with itemsProcFunc
<itemsProcFunc>tx_getDataFromXlsxFile->addFields</itemsProcFunc>
And the a claas.getDataFromXlsxFile.php file

LimeSurvey - Uploading a PDF

I've been using LimeSurvey to create a survey. There is a question type called File Upload that allows a user to upload a file instead of answering a question. As far as I can tell, the question type does not allow the user to upload a PDF. Is anyone aware of a workaround for this problem?
Its mostly you do not have the directories "upload" and "tmp" with write permissions. Make this necessary change and it should all be fine.
amit
If you click on the 'advanced settings' for the file upload question, there's an entry for file type that's just a comma-separated list of extensions to allow.

How do I get hold of my access logs from CloudControl

This may seem like a stupid question, but:
If I have an app deployed to CloudControl, how can I download the access logs directly.
Of course I can cctrlapp myapphere/default log access to 'tail' them.
... but I want to download them for off line analysis.
I checked the documentation, but it there is an obvious way I missed it -= can anyone help ?
Thanks
There is no way to "download" the logs. We only store the last 500 messages.

Meteor File Uploads

I see that this has been asked here before, but nothing since Meteor.http has been available. I'm still grasping the concepts of Meteor and file uploads are totally eluding me.
Here's my question:
So, in what I believe to be the right method,
Meteor.http.call("POST", url, [options], [asyncCallback]) what do you put for the url? With the client/server javascript relationship in meteor, it doesn't seem like it really uses urls that much.
If anyone has a basic example of a file upload in meteor, that would just be extra awesome.
well been playing a bit with meteor. Made a collectionFS a mix of meteor and gridFS (could be compatible).
Test it here: http://collectionfs.meteor.com/
It support quit large files, multiple files, users etc. I've tested a 50Mb seems ok, if connection is lost or browser dies the user can resume upload.
It should even be possible to have multiple users upload to exact same file - haven't quit found a usecase for it, but it's possible.
Accounts, publishing etc. is as with collections - the test is in autopublish mode, though only meta data is avaliable - chunks of data is served in background via blobs.
I'll try getting it on github,
Take a look at filepicker.io. They handle the upload, store it into your S3, and return to you the url that you can dump into your db.
Wget the filepicker script into your client folder.
wget https://api.filepicker.io/v0/filepicker.js
Insert a filepicker input tag
<input type="filepicker" id="attachment">
In the startup, initialize it:
Meteor.startup( function() {
filepicker.setKey("YOUR FILEPICKER API KEY");
filepicker.constructWidget(document.getElementById('attachment'));
});
Attach a event handler
Template.templateNameHere.events({
'change #attachment': function(evt){
console.log(evt.files);
}
});
(I had posted on How would one handle a file upload with Meteor? Sorry. I'm new here. Is it kosher to copy the same answer twice? Anyone who knows better can feel free to edit this.)
Checkout how to accomplish this using Meteor.Method on the server and the FileReader's api on the client
https://gist.github.com/dariocravero/3922137
After several searches, this looks to me the easiest (and for the moment the meteor's style way) to handle a file upload with no extra dependencies.
Since meteor includes JQuery by default, you can utilize a Jquery plugin for that, i presume, something like: https://github.com/blueimp/jQuery-File-Upload/wiki/Options can do the trick for you, and supports both GET and PUT.
Otherwise it would be a pain in the ass to get it to work, but not impossible, since you can access PUT in meteor.
If you would prefer a more pure JS sollution maybe you can look at: http://igstan.ro/posts/2009-01-11-ajax-file-upload-with-pure-javascript.html
And adapt it.
There is no ready made support for file uploads so share what you come up with, i would be very interested!
Alternatively (if you wouldn't like to use a 3rd party solution like filepicker) you could use the meteor router package.
This handles the HTTP requests on server-side.

yii: serve a file when logged in

I have pdf files in a htaccess-protected directory that I want to show to some users in Yii application.
How is best to solve that? I understand it should be done inside Yii, not with a separate script as it needs to check if a valid user is logged in.
Access control filters
You would do your appropriate security checking (user is in group, or has permission or whatever) and then you would use readfile or something similar.
Do you have code already that isn't working? Or did you just need help with what approach to take?
Thanks!
I got some idea from this link:
http://harrybailey.com/2011/07/yii-rewrite-files-or-images-for-download-or-display/
In short: made a new actionfunction into controller and in that function sending headers and readfile.