I am making a photo shooting contest, the competitor should register using a Google registration form, and upload his photo as well. I searched all over the internet to find a Google script that can be inserted into a form to upload a file using Google forms but could not find anything. Is it doable and how, and even if there can be other ideas to do such thing please let me know.
相关问题
- How can I force all files in a folder to be owned
- Google Apps Script: testing doPost() with cURL
- Google Apps Script to turn in, grade, and return a
- Script fails on SpreadsheetApp.openById - Requires
- Split Lines and Bold Text within a ui.alert Window
相关文章
- How to allow access for importrange function via a
- Google app script trigger not working
- Set Date/Time to 00:00:00
- indexOf returning -1 despite object being in the a
- How can my Google Apps Script be run by others the
- How to stop execution of Google Apps Script?
- Profiling the Performance of a Google App Script
- String starts with in Google Script
EDIT : I
upgradechange the code a little bit, because as yyk mentionned,UiApp"doclist" deprecated since December 11, 2014. I use it to create a trombinoscope (i don't know the word in english, group gallery perhaps) in a google doc, people uploaded their picture nd name in a form. I don't use a spreadsheet. Here is the code :Try this
This link might help you as well :)
http://code.google.com/googleapps/appsscript/class_documentapp_listitem.html#appendInlineImage
Happy coding !
Here is a possible workflow suggestion that includes a form, a spreadsheet with responses and a doc with included images.
the form is testable here
the spreadsheet is viewable here
the doc is viewable here
See EDIT 2
NOTES :
And here is the full code, still a draft but I think it could be fully implemented if we find a solution to the aforementioned problems.
EDIT : The size of the image is actually not relevant, I had success with images 4 times larger than the page size but in PNG format - it seems that .png is far more reliable in this context, that's after all good news! btw, I can use indifferently the blob, the image file or the so-called thumbnail (which has the very same size as the original ;-) and I get always the same result. I guess I'll have to post an question on that in another post :-D=
EDIT 2 : I have found solutions for (almost) all the issues... Here is the new code (only doPost part) that provides automatic image scaling for the doc preview. Jpg, png or any other usual image format supported...and shows initial size + weight. I updated the online test form.
The spreadsheet issue has no solution for now, see issue 145, so I use only a link to the image file but this one has no preview as stated in issue 1239 but the document as it works now is a nice and useable workaround (in my opinion :-).
To get a direct link to the image in the spreadsheet, use the
getID
function instead ofgetUrl
and prepend the URL toGdrive
.Change this:
To this:
Thanks to jfreake recent post I ended up solving all the issues, including show the images in the spreadsheet itself. Here is the final code I post in a separate answer for comfort and readbility.
links are the same : app SS doc