Hi,
i want to upload files jpg,pdf etc?
i have created form with a field fileand a button:
1 what code to write on button to upload file?
2 where the file will be saved?
3 can i fix the size for file to upload?
Please help...
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
upload file
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: upload file
1. No coding is required. Just place a Input:File Object on your form.
2. The files are stored in the database
3. The Limit is 300 Kb
The get the size, set a limit, add an event listener. E.g.
https://wiki.nubuilder.cloud/ ... .php/Files
2. The files are stored in the database
3. The Limit is 300 Kb
The get the size, set a limit, add an event listener. E.g.
Code: Select all
var myFile = document.getElementById('visitors_photo_file');
myFile.addEventListener('change', function() {
alert('File size ' + this.files[0].size);
if (size > 100000) { // if the file is bigger than 100KB, clear the input file
this.value = '';
}
});
https://wiki.nubuilder.cloud/ ... .php/Files
-
- Posts: 38
- Joined: Wed May 16, 2018 1:01 pm
Re: upload file
I have entered the code in BS, it is showing alert when file size is greater than given size but there is error when size under the given size...
and how do i access these uploaded files, want to provide a link to open file after it uploaded...
and how do i access these uploaded files, want to provide a link to open file after it uploaded...

You do not have the required permissions to view the files attached to this post.
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: upload file
This is Javascript, not PHP!
Downloading the files again might be trickier. "Home ► Stored Files" could give you ideas on how to do that.
In any case, your should have a (good) knowledge of javascript.
Downloading the files again might be trickier. "Home ► Stored Files" could give you ideas on how to do that.
In any case, your should have a (good) knowledge of javascript.
-
- Posts: 38
- Joined: Wed May 16, 2018 1:01 pm
Re: upload file
ok, thankstoms wrote:This is Javascript, not PHP!
Downloading the files again might be trickier. "Home ► Stored Files" could give you ideas on how to do that.
In any case, your should have a (good) knowledge of javascript.
i will try to find out solution.
There should be an easy way to access uploaded files to make any application meaning full

-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am