The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

File Upload Not working

Labels

This Discussion is public

Notifications

I have a standard file upload field, works fine when logged in as administrator, but hangs when logged in as a user.

The 'tick' symbol appears but the progress bar stays over the photo upload and the submit button is a spinning half circle.

I am working locally on a local server so file permissions not an issue, I have confirmed this.

The file is not saved to the file system.

I am using the latest version of Formidable, it's a fresh development and Formidable is the only plugin installed.

There are no PHP or Apache errors in the logs. Everything else works perfectly.

Any help with identifying what the problem is here would be very much appreciated.

Formidable changed the file upload procedure sometime ago from PHP to a jQuery library that uses Ajax to upload files. Files are not uploaded to the media library, but to a formidable sub-directory in the wp-content/uploads directory. Make sure the plugin has the permissions to create the sub-directory and any additional directories it creates underneath it. You may also have to inspect the network traffic and ajax return codes in the browser's console to gain further insight into what may be going on.

Thanks Victor,

I just upgraded the user to an administrator and it works - obviously this is impractical for a live site. None of the other user levels, i.e. author, contributor, editor, work.

I have been through the folders and assigned rwx permissions to all the relevant directories including the formidable one and the subdirectory there.

There is an AJAX error when the file upload crashes:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

n.parseJSON
http://g.ac.uk/wp-includes/js/jquery/jquery.js:4:16639
a.parseJSON
http://g.ac.uk/wp-includes/js/jquery/jquery-migrate.min.js:2:3811
init/<
http://g.ac.uk/wp-content/plugins/formidable/js/formidable.min.js:8:150
Emitter.prototype.emit
http://g.ac.uk/wp-content/plugins/formidable/pro/js/dropzone.js:58:11
Dropzone.prototype._finished
http://g.ac.uk/wp-content/plugins/formidable/pro/js/dropzone.js:1394:9
Dropzone.prototype.uploadFiles/xhr.onload</<

But I really don't know what this means :(

Also, I don't know how to assign permissions to a plugin -actually I never heard of this before - there is only one plugin and it's Formidable.

Any ideas?

The plugin inherits permissions from the localhost owner.

The fact that the first character referenced in the third line is <, it could be indicative of a PHP or jQuery syntax error. This error can also occur with empty strings. Whatever the case, the level of troubleshooting you require is far beyond the scope of what I can help you with in this community forum. I suggest you open up a help ticket with the Formidable team.

Oh right I see what you mean with permissions now, yes it's fine!

Sure, thanks for your help anyway :)

Formidable is not helping me out here, just causing major headaches and I am against a tight deadline - will have to look elsewhere for something that works because this is a bottomless pit of time and cash eating!

 

This could be because you're in a local environment. They may not happen on a remote server. I've had issues before with Ajax in a local environment. When I moved the site to a server, all worked as expected.

That's a great point - definitely worth a try before I go on a mission!!

Thank you very much once again :)

All the best!!

I finally worked out what was causing this, nothing to do with Formidable, just a bit of rogue code interfering with AJAX calls.

I found it by commenting out various bits of code that I had in my theme custom.php file.

Thanks again

Steve

Discussion closed.