Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

upload file to server

Questions related to customising nuBuilder Forte with JavaScript or PHP.
johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: upload file to server

Unread post by johan »

That would be nice but didn't work when uploading to our server.
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: upload file to server

Unread post by kev1n »

I'm preparing an example to upload a file per row.
johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: upload file to server

Unread post by johan »

Wonderfull, thanks for your help.
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: upload file to server

Unread post by kev1n »

johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: upload file to server

Unread post by johan »

Kevin
Thanks for your help. I've tried to set this up in my Nubuilder

When I upload a file I get the error Upload failed.

Only thing I've modified is this part of form_custom_code.js so it points to my table.

Code: Select all

var uploadFolder = 'libs/upload/documents/';
var idFileName = 'files_file_name';
var idFileId = 'files_file_id';
var idSubForm = 'sample_files';
Any idea what I missed?
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: upload file to server

Unread post by kev1n »

Do you see any error messages in the developer console (F12)? or your PHP log file?
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: upload file to server

Unread post by kev1n »

There was a mistake:

Replace this

Code: Select all

createDownloadLink(idSubForm + nuPad3(i) + fileNameId, uploadFolder, fileId, fileName);
With

Code: Select all

createDownloadLink(idSubForm + nuPad3(i) + idFileName, uploadFolder, fileId, fileName);
in form_custom_code.js
johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: upload file to server

Unread post by johan »

This error

Code: Select all

ReferenceError: nuStopBrowserResize is not definedindex.php line 82 > scriptElement:79:5
    <anoniem> https://registratie.cawdekempen.be/preventie/index.php line 82 > scriptElement:79
    jQuery 3
    nuAddJavascript https://registratie.cawdekempen.be/preventie/nuform.js?ts=20180509002054:2994
    nuBuildForm https://registratie.cawdekempen.be/preventie/nuform.js?ts=20180509002054:122
    successCallback https://registratie.cawdekempen.be/preventie/nuajax.js?ts=20180509002054:109
    success https://registratie.cawdekempen.be/preventie/nuajax.js?ts=20180509002054:15
    jQuery 4
        fire
        fireWith
        done
        callback
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: upload file to server

Unread post by kev1n »

Just remove or comment out nuStopBrowserResize (); (seems like you are not using the latest nuBuilder - this function has been added recently)
johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: upload file to server

Unread post by johan »

Kevin
I've replaced the part of the code even removed nuStopBrowserResize () but still get the same error.
Post Reply