LimeSurvey - Uploading a PDF - 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.

Related

Potential bug in GCP regarding public access settings for a file

I was conversing with someone from GCS support, and they suggested that there may be a bug and that I post what's happening to the support group.
Situation
I'm trying to adapt this Tensorflow demo ...
https://www.tensorflow.org/hub/tutorials/tf2_arbitrary_image_stylization
... to something I can use with images stored on my GCP account. Substituting one of my images to run through the process.
​​I have the bucket set for allUsers to have public access, with a Role of Storage Object Viewer.
However, the demo still isn't accepting my files stored in GCS.
For example, this file is being rejected:
https://storage.googleapis.com/01_bucket-02/Green_Sea_Turtle_grazing_seagrass.jpeg
That file was downloaded from the examples in the demo, and then uploaded to my GCS and the link used in the demo. But it's not being accepted. I'm using the URL from the Copy URL link.
Re: publicly accessible data
I've been following the instructions on making data publicly accessible.
https://cloud.google.com/storage/docs/access-control/making-data-public#code-samples_1
I've performed all the above operations from the console, but the bucket still doesn't indicate public access for the bucket in question. So I'm not sure what's going on there.
Please see the attached screen of my bucket permissions settings.
So I'm hoping you can clarify if those settings look good for those files being publicly accessible.
Re: Accessing the data from the demo
I'm also following this related article on 'Accessing public data'
https://cloud.google.com/storage/docs/access-public-data#storage-download-public-object-python
There are 2 things I'm not clear on:
If I've set public access the way I have, do I still need code as in the example on the 'Access public data' article just above?
If I do need to add this to the code from the demo, can you tell me how I can find these 2 parts of the code:
a. source_blob_name = "storage-object-name"
b. destination_file_name = "local/path/to/file"
I know the path of the file above (01_bucket-02/Green_Sea_Turtle_grazing_seagrass.jpeg), but don't understand whether that's the storage-object-name or the local/path/to/file.
And if it's either one of those, then how do I find the other value?
And furthermore, to make a bucket public, why would I need to state an individual file? That's making me think that code isn't necessary.
Thank you for clarifying any issues or helping to resolve my confusion.
Doug
If I've set public access the way I have, do I still need code as in the example on the 'Access public data' article just above?
No, you don't need to. I actually did some testing and I was able to pull images in GCS, may it be set to public or not.
As what we have discussed in this thread, what's happening in your project is that the image you are trying to pull in GCS has a .jpeg extension but is not actually .jpeg. The actual image is in .jpg causing TensorFlow to not able to load it properly.
See this testing following the demo you've mentioned and the image from your bucket. Note that I used .jpg as the image's extension.
content_urls = dict(
test_public='https://storage.cloud.google.com/01_bucket-02/Green_Sea_Turtle_grazing_seagrass.jpg'
)
Also tested another image from your bucket and it was successfully loaded in TensorFlow.
Most likely the problem is your turtle ends in .jpeg and your libraries are looking for .jpg.
The Errors you're seeing would be much more helpful to figure out the problem.

Save comments in config.yml with api spigot/bukkit

I have a config.yml file that has some comments like:
#Thats the message when someone joins to the server
Message: Hello User
But when I save the config.yml file and open again it vanishes and can't be saved.
I tried to search some api for this problem but could not find.
I dont want to use
saveDefaultConfig();
or
getConfig().options.copydefault(true);
saveConfig();
because I dont want to save this trough code. I want to save this with api.
What api should I use?
I would recommend you to use the Spigot API, on my opinion it's the better one
Both API's only support ONE comment in the header section of the config. If you want to save more than one comment you should code your own YAMLConfiguration
To save this one header you should try
getConfig().options().header("Your Comment");
getConfig().options().copyHeader(true)
You can seperate the comment with \n into mutliple lines
You can create a config.yml inside your src folder which will be included into the jar. You can set your default values and any comments by editing this file in your IDE. All you have to do in your main class is calling saveDefaultConfig(); in your onEnable(). After that, you can use getConfig() to access your configuration.
Thats sadly not possible when using the given Tools!
You need to manually write your own ConfigManager where you can do that!
Here is what I got: https://mega.nz/#!lsIkVYhD!knZr5DBmbvPyJh8ONeNx4pfb7Q0C9yuIp6FHiyJmhBw
It may however have a few bugs :D
As stated, the Yaml API provided with Bukkit will strip comments when it is written to. So you can comment your resource config file but comments are lost when it is saved or re-written by the API.
My preferred Yaml handler is SimplixStorage. It handles comments well both at the top and anywhere inside a yaml file. I also found SimpleConfig which allows you to add header, add comments (which are not removed on file saves), as well as add to config with your code.

XPages POI4Xpages download to network location

Using POI4Xpages which is great LINK
However, I was wondering, at present, when it creates my word document, it simply downloads, like a normal download from the internet, storing it the downloads folder in windows (using Chrome anyways)
Is there a way, using POI4XPages, to instead, dump the file to a specified network location, for example a shared drive?
After that, I would simply build a link to the file using the network location, and a filename variable for example to pick the correct file.
If thats not possible, is it possible to get a handle on the file before or after it is downloaded, and then save it to a field in the xpage?
In short, I want to avoid the user downloading the file, then having to attach it manually to the xpage.
Thanks
POI allows you to get a handle to the file using the variable "workbook". You are also able to provide the specific downloadFileName you wish to use. Using the postGenerationProcess property you should be able to make a call to a Java method that makes the connection to your network drive where you can use the "workbook" variable and downloadFileName value to save your document. If this doesn't work definitely post a question on their project site because the creator does reply.

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

Joomla: Allowing a user to upload an image

Alright so I learned that to have an upload button on a page, what you do is basically call a php file (call is upload.php) that would upload a file to the server. I have no idea where I am supposed to put the php file inside the server so I can call it.
I feel stupid because I can't find any answers online. I am getting very frustrated and confused because I am told I need to create a database but I have no idea how to edit a database in Joomla. I took a class in SQL so I don't have to learn about that. I just don't know where it is. I was also told I need to make a component. But this is confusing because all I want to do is have an upload button that will upload an image to the server.
I understand your frustration. I've got the basic idea on what you are trying to do. Here are a couple of options:
You might wanna take a look at Joomla! Extensions Directory ™. You might just find there a component or a module that already does this for you.
If you want to do it on your own, than you need to create a small module or a component inside Joomla! Please refer to the Joomla! Documentation or tutorials on this topic. Please note that you won't get this working instantly, because you first need to understand how Joomla! works. So your upload.php file will go in your module / component files. I don't think you need to do any SQL.
Now the part with "allowing a user" is a bit confusing... you want to "allow" any user to upload things to your server or just let's say, registered users? Generally uploading scripts need to be very strong from the security point of view. If this is the case, that you need to do a search for Joomla! ACL
You can simply create a form and add the "media" field type.
http://docs.joomla.org/Standard_form_field_types
You can also opt for the "file" field types to allow different types of fields.
Both fields can be added using the Joomla Component Creator: http://www.notwebdesign.com/joomla-component-creator/
And you might also want to take a look at K2 which has an excellent image upload functionality that allows scaling of images into three different sizes.