Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

upload file to server

Questions related to customising nuBuilder Forte with JavaScript or PHP.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: upload file to server

Unread post by kev1n »

johan wrote:Kevin
I've replaced the part of the code even removed nuStopBrowserResize () but still get the same error.
If you're getting the same error

Code: Select all

ReferenceError: nuStopBrowserResize is not definedindex.php line 82 > scriptElement:79:5
that means the function is still there. Try refreshing the form.
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 don't get that error but still can't upload.
Maybe I have to update my nuBuilder.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: upload file to server

Unread post by kev1n »

johan wrote:Kevin
I don't get that error but still can't upload.
Maybe I have to update my nuBuilder.
Are you using nuBuilder4?
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 »

Yes
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: upload file to server

Unread post by kev1n »

This script is supposed to work with all nuBuilder4 versions.

Did you revise the upload directory and allowed extensions in upload.php?

Code: Select all

$uploaddir = './documents/';
$allowed = array(
    'pdf',
    'docx'
);
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 »

Kev1N
My mistake. I forgot to put upload.php in folder upload. It was in libs.

Now I got upload succesfull but fields name, ... are empty
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: upload file to server

Unread post by kev1n »

Could you add this alert() to your code?
alert.png

Code: Select all

 alert('result.file_name: ' + result.file_name + ' / ' + 'result.file_id: ' + result.file_id + '/ idRowFileName: ' + idRowFileName + '/ idRowFileId: ' + idRowFileId);
This is to see if the variables get populated correctly
You do not have the required permissions to view the files attached to this post.
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

In witch part do you want me to put this? (js - html or php)
Even though he says upload successful I don't see a file in documents

Johan
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: upload file to server

Unread post by kev1n »

I updated these 3 files to get more accurate error messages. https://github.com/smalos/nubuilder-cod ... le_subform

form_custom_code.js
input_type_file.htm
upload.php
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: upload file to server

Unread post by kev1n »

johan wrote:Kevin

In witch part do you want me to put this? (js - html or php)

Johan
This is in input_type_file.htm
alert.png
You do not have the required permissions to view the files attached to this post.
Post Reply