ExpressionEngine channel form file upload - forms

I'm trying to allow my users to upload a videos. My channel has "file" as the first channel field.
Made a channel form with the following code. When I try to upload anything I get the error field_id_5 is a required field (this is my file field). The only way i get the form to go through is if I make the video file not require, in which case all the other info goes through.
WHen i create a post in this channel through the EE control panel, it works. Video file is uploaded and all and it shows up in my channel in the video player.
Any help? Very new to coding so it may be a very simple mistake somewhere.. apologies :)
I managed to get it working with {field:video_file} instead of input tags but then I can't control what types of files they can send...
{exp:channel:form channel="video_post_uploaded"}
<p class="form_text">Post Title:
<br><input type="text" name="title" id="title" value="{title}" onkeyup="liveUrlTitle();" class="form_input">
<!-- <p>URL Title: -->
<br><input type="hidden" id="url_title" name="url_title" value="{url_title}" class="form_input">
<!-- <p class="instructions">Don't worry about this one, it fills itself out automatically. -->
<p>Upload Video:
<p><input type="file" name="video_file">
<p class="instructions">{instructions:video_file}
<p>Game:
<br><select name="game_title_uploaded">
{options:game_title_uploaded}
<option value="{option_value}"{selected}>{option_name}</option>
{/options:game_title_uploaded}
</select>
<p class="instructions">{instructions:game_title_uploaded}
{status_menu}
<select name="status" class="hidden">
{select_options}
</select>
{/status_menu}
<p><input type="submit" value="Post It!" class="submit_button">
{/exp:channel:form}

You cannot use it with just input type file. EE needs another hidden field to indicate directory of file to upload.
You can use it like this:
<input type="file" name="video_file">
<input type="hidden" name="video_file_directory" value="1">

Related

How to send data in form secretly

I want send hidden data with form.
my code is:
` <form action="my address" method="post">
<div>
<label for="title">Post title:</label>
<input type="text" id="title" name="title" value="My excellent blog post" />
</div>
<div>
<label for="content">Post content:</label>
<textarea id="content" name="content" cols="60" rows="5">
This is the content of my excellent blog post. I hope you enjoy it!
</textarea>
</div>
<div>
<button type="submit">Update post</button>
</div>
<input type="hidden" name="seckey" value="34657" />
</form> `
I use hidden input, but is not safe.
I want to send "seckey" secretly in a way ,that is not available in any way and anybody not access it. Completely safe
but if I use hidden input, the "seckey" is visible in the source page or inspect element in browser.
How to post the "seckey" in the form without it even being clear in the page source

how to store the contact us form data in the google forms for my website

I would like to store the contact us form data in my google form. I have created contact us form in my webpage and copied the google form link in my form link. Kindly tell the steps to make the form work
Here the code that I have written
<div class="form-group">
<form action="https://docs.google.com/forms/d/e/1FAIpQLSedlnzPGGIwjq_C3W0KCev-WexWs6SFdf7nk0sWT3v2wP6fA/viewform?usp=sf_link" class="comment-form contact-form" novalidate="novalidate">
<input type="text" class="form-control" placeholder="Name" name="name">
<input type="text" class="form-control" placeholder="Mail Address" name="email">
<textarea name="message" class="form-control" placeholder="Comment"></textarea>
<button type="submit" class="contact-us thm-btn"><span>Post Now</span></button>
</form>
My google form link is placed n the action which is https://docs.google.com/forms/d/e/1FAIpQLSedlnzPGGIwjq_C3W0KCev-WexWs6SF-df7nk0sWT3v2wP6fA/viewform?usp=sf_link
The google form data is accessible via google sheets.
You also have the ability to create a trigger that will do something with the data when the form is posted, more information on this can be found at.
https://developers.google.com/gsuite/add-ons/concepts/editor-triggers

Unable to receive form submissions on Netlify deploys

I am using a simple form that was taken from one of the Netlify related docs:
<form name="contact" action="/" method="post" data-netlify="true">
<div className="field">
<label htmlFor="name">Name</label>
<input type="text" name="name" id="name" value="dave"/>
</div>
<div className="field">
<label htmlFor="email">Email</label>
<input type="text" name="email" id="email" value="email#email.com" />
</div>
<div className="field">
<label htmlFor="message">Message</label>
<textarea name="message" id="message" rows="6"></textarea>
</div>
<input type="submit" value="Send Message" className="" />
</form>
In using gatsby develop and working with/submitting the form, things seem to work fine. I get no errors and get redirected to the home page as expected.
After deploying the site with Netlify and trying to submit the form, I get the following page error:
In my Netlify backend, the form appears in the console but I cannot/do not receive submissions.
I am using a barebones gatsby-config.js, only incorporating gatsby-source-wordpress and gatsby-plugin-google-analytics.
I also tried adding /no-cache=1 to form action.
Can anybody advise?
It might also be worth noting that I have coded my form as a component and am importing it into my footer as such. In that way, it may be imported multiple times on different pages as mentioned in point 3 of this StackOverflow answer.
Thanks.
I learned that because I'm using Gatsbyjs, and Gatsby + Netlify = javascript forms, I needed to add another input type="hidden" to my form:
<form name="my-form" ... >
<input type="hidden" name="form-name" value="my-form" />
The documentation for this wasn't immediately clear but below are some links that address this:
Here's a link to an article that pointed me to the answer: How to
Integrate Netlify’s Form Handling in a React App
Here's another one if you're building in Vue: How to Integrate
Netlify Forms in a Vue App
And all about Netlify Forms
If you are using any redirect method then you have to add _redirects file in your root folder and add paths to it so that redirect can work.
It's may be confusing but you can visit this link for more help.

Can you tell me how to find out where form info goes?

Thank you for taking a look at my post. I have this newsletter form and it appears to be working fine, but I don't know where the information goes!
<form id="subscribe-form" name="sibscribe" method="post">
<label>
<input class="subscribetext" type="text" onFocus="if(this.value =='Enter E-mail:' ) this.value=''" onBlur="if(this.value=='') this.value='Enter E-mail:'" value="Enter E-mail:" name="keyword" />
</label>
<a onClick="document.getElementById('subscribe-form').submit()" class="button" href="Thank You.html">subscribe</a>
</form>
The best way to figure out for you is to go to Firebug Net bug while the page/form submits and inspect the tabs like:
Params| Headers|Responses|XML|Cookies

Safari 3.2.1 sends POST followed by GET requests

I've a servlet running on Tomcat 5.5.27 and 5.5.26 and have a web form with POST method.
If I use Safari 3.2.1 I see from the logs that Tomcat receives a POST followed immediately/contemporarily by GET and it fails.
If I use Firefox 3.0.5 I see that it sends only POST and everything works.
Trying to debug with Eclipse I see that when using Safari it is the doGet() method that is called while when using Firefox is doPost().
Practically it seems that Safari fires both POST and then immediately GET, while Firefox fires only POST (as it should according to the HTML form).
Is there somebody else who as experienced this ? In this case is there a solution ?
Here is a snippet of the HTML form:
<form action="/vidisearch/Search" method="post" name="SearchForm" id="SearchForm">
<div class="input required">
<label for="Concepts">Concepts, comma separated<br />
ex. (remove quotes) "man-made object, cemetery, graphic event, atmospheric event, tool event"</label>
<input name="concepts" type="text" value="" id="concepts" />
</div>
<div class="input required">
<label for="Operators">Operators, comma separated<br />
ex. (remove quotes) "NOT, AND, OR, AND, AND"</label>
<input type="text" name="operators" value="" id="operators" />
</div>
<div class="input required">
<label for="Specializations">Specializations, comma separated<br />
ex. (remove quotes) "true, false, false, true, false"</label>
<input type="text" name="specializations" value="" id="specializations" />
</div>
<div class="input required">
<label for="Results">Various parameters</label>
<table width="100%" border="0" style="border: 0;">
<tr>
<td>Ontology ID<br />
<input name="ontologyID" type="text" id="ontologyID" value="" /></td>
<td>Result page<br />
<input name="page" type="text" id="page" value="0" /></td>
<td>Shots per page<br />
<input name="shotsPerPage" type="text" id="shotsPerPage" value="20" /></td>
<td>New search<br />
<input name="newSearch" type="text" id="newSearch" value="true" /></td></tr>
</table>
</div>
<div class="submit"><input type="submit" value="Search" /></div>
</form>
I think you have an image tag that has an empty src.
It's hard to say without seeing your HTML for the form, but perhaps your submit button is a wrapped with a link, and Safari is both POSTing the form and following the link (via GET).
I'm not sure what's happening but what I do know is that you need to provide more information.
Maybe it's sending a GET for associated resources (like images) whereas Firefox keeps them in the cache, or you have the form submit button inside an <a> tag, for instance.
Another alternative is a Javascript incompatibility, in case you are submitting something via Javascript.
Sniff the traffic (check out Fiddler or Wireshark) and see what is Safari trying to GET and what's it is POSTing
I'm quite puzzled by the behaviour of Safari since I remind that sometime ago it worked. I'm fearing that one of the latest upgrades has broken something.
Using HTTPScoop I've seen that apparently Safari fires POST followed by GET when it gets the response. I think however that it actually fires both requests at the same time since the date+time of the two responses is the same for both POST and GET.
The response is a RSS feed and has the HTTP/1.1 200 OK code. The second GET asks for the same request URL (http://127.0.0.1:8180/vidisearch/Search) of the POST but the body is 0 bytes, it has of course no GET parameters and the answer is wrong because of the missing parameters.
Firefox instead fires only the POST and gets the correct answer.