Upload button not working

Issues related to forms.
Post Reply
Fabian
 
 
Posts: 25
Joined: Sat Apr 20, 2019 3:17 pm

Upload button not working

Post by Fabian » Sun Apr 28, 2019 2:37 pm

After uploading a new site to the internet I tried out the upload button I'd added to a page ( https://micromartuk.com/Article_Spinner.php ) so my customers could send me their articles, so I could spin them to get 50 fresh content articles for them.

Now the 'Browse button works fine as I found the article on my desktop and it appeared in the little window, but when you come to push the submit button nothing happens. It just sits there doing nothing.

I followed the directions and it should send an email to a Gmail account (I made a brand new Gmail account especially for this page so it's separate from the other three Gmail account's that I all ready have and nothing else will be using it).

I don't know why it won't work as everything else on the site seem to be working OK.

Can someone have a look at it and tell me what's wrong. I'd be most grateful.

Thank you.

User avatar
BaconFries
 
 
Posts: 4467
Joined: Thu Aug 16, 2007 7:32 pm

Re: Upload button not working

Post by BaconFries » Sun Apr 28, 2019 3:04 pm

Please read the following on
Why shouldn't I use 'mailto' in the form action?
I would recommend that you use the forms processor for this, I would also say take sometime to read how to Creating a Form as it will save you any issues.
Without being rude I would be looking at how are you going to gather the uploaders details/information eg name, email etc as you haven't included any form fields for this.

User avatar
Pablo
 
Posts: 15928
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Upload button not working

Post by Pablo » Sun Apr 28, 2019 3:14 pm

- By itself, the File Upload object does nothing, except for providing a way to select a file. To process the submitted file you will need a script at the server side. For example, the built-in form processor script.
- When using the built-in PHP form processor, the generated script will automatically take care of attaching the selected file(s) to the email message after the form has been submitted.
- Most hosting services limit upload size to between 2 and 4 Mb. While you can control the upload limit by adding an hidden field called 'filesize' with the size in kB, it will nevertheless comply with the limits imposed by the hosting providers.
- If you choose not to use the built-in form processor, then you must implement a script to handle file uploads yourself!

Tutorial about the built-in form processor script:
http://www.wysiwygwebbuilder.com/forms.html

See also the information in the help.

Fabian
 
 
Posts: 25
Joined: Sat Apr 20, 2019 3:17 pm

Re: Upload button not working

Post by Fabian » Sun Apr 28, 2019 6:41 pm

I understand your concerns regarding 'Uploading Files' to your email account, but I'd like to think I took some precautions to cover myself in case some d*c* h*a* thinks it's funny to upload something nasty.

But I bow to your experience in these matters and gone with the PHP instead. Now I can get the file in the browser window and the submit button takes me to an empty page, well its a step further than I was a couple of hours ago.

I did this

Form Wizard
Create a new form based on a template
File Upload
Removed File 2 and pressed the Next button
Use Built-in PHP Form Processor to send data to an email address
Filled in my email address and subject line and pressed finished


Something's not quite right is it.

User avatar
Pablo
 
Posts: 15928
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Upload button not working

Post by Pablo » Sun Apr 28, 2019 8:25 pm

Did you specify a success and error page? Otherwise the form will go nowhere...
Did you set the file upload setting in the form's properties? Otherwise the file will be upload to nowhere.
Did you make sure the upload folder on the server is writable? Otherwise the file cannot be saved on the server.
Also as previously mentioned. make sure the file is not too big. Your web host may have a file size limit.

Fabian
 
 
Posts: 25
Joined: Sat Apr 20, 2019 3:17 pm

Re: Upload button not working

Post by Fabian » Mon Apr 29, 2019 9:18 am

When I used the Form Wizard it didn't ask me for those things you pointed out. I just followed the on-screen directions. All those points weren't in the set-up to make a form.

In the Form Wizard, I picked the first option and then the 'File Upload' then the PHP and then filled in the two lines I was asked to, which was my email address and subject. The two lower boxes (Success URL & Error URL ) were greyed out so I couldn't fill them in. I thought this was because I was using PHP and that would take care of the greyed out stuff on the form.

My service provider's file limit was 128mb, but they increased it to 1024mb which is ample for an article to be uploaded. Articles are usually around 500kb and only made up of text anyway, but it's always best to prepare for the worst.

By the way, the words d*c* h*a* was the best way to describe the sort of people that abuse 'file uploads' sorry if it offended you.

User avatar
Pablo
 
Posts: 15928
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Upload button not working

Post by Pablo » Mon Apr 29, 2019 10:53 am

The form wizard only sets up the initial layout. It does not configure file uploads or create an upload folder on the server.

To make the File Upload work you must:
- specify a success and error page
- set the file upload setting in the form's properties
- make sure the upload folder on the server is writable

Fabian
 
 
Posts: 25
Joined: Sat Apr 20, 2019 3:17 pm

Re: Upload button not working

Post by Fabian » Tue Apr 30, 2019 9:03 am

Hi
I took your advice and made changes to my form, but when I push the submit button it takes me to the 'success page but the file doesn't go to my email address as it should.

In your post you say - set the file upload setting in the form's properties, are you talking about the email address the article goes to after you press the submit button as I set this to my new email address.

And could you elaborate on the last line, 'make sure the upload folder on the server is writable' I don't understand what that means.

I'm trying my best to comply with what you said, but it new to me and I'm having trouble putting your directions into motion.

Please be patient as I will eventually get there.

User avatar
Pablo
 
Posts: 15928
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Upload button not working

Post by Pablo » Tue Apr 30, 2019 9:36 am

By default, the file will not be sent as an attachment of the email. It will be stored in a folder on the server.
For that to work you must create an upload folder with write permission so the file can be saved.
The file upload properties can be configured in the properties of the form. The folder and permissions need to be set on the server.

If you want to sent the file as an attachment of the email then you need to enabled 'PHP mailer' in the form properties.

Fabian
 
 
Posts: 25
Joined: Sat Apr 20, 2019 3:17 pm

Re: Upload button not working

Post by Fabian » Thu May 02, 2019 8:20 am

In the end, I couldn't get my head around this problem, Its not you, it's me.

O I've gone down a different path to sought this problem.

Thanks for trying.

windsurfer
 
 
Posts: 30
Joined: Mon May 13, 2019 9:15 pm

Re: Upload button not working

Post by windsurfer » Tue May 28, 2019 1:38 pm

I got it working just fine but is it not possible to have the images attached to the notification email ?
I used to have a photographic memory but i ran out of film !!!

User avatar
Pablo
 
Posts: 15928
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Upload button not working

Post by Pablo » Tue May 28, 2019 2:12 pm

The built-in script does attach images to the notification email, if you need that functionality then you will need to implement a custom script.

Post Reply