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.
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
Re: upload file to server
Kev1n
This is my result
This is my result
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: upload file to server
Add
in this code (input_type_file.htm) and open the developer console (F12).
Then upload the file and press F10 when the debugger stops to jump to the next row and to investigate the variables.
Video:
https://streamable.com/x1y19
result.error should be empty if the upload was successful.
Code: Select all
debugger;
Then upload the file and press F10 when the debugger stops to jump to the next row and to investigate the variables.
Video:
https://streamable.com/x1y19
result.error should be empty if the upload was successful.
You do not have the required permissions to view the files attached to this post.
Re: upload file to server
Kev1n
I get this error
I don't understand why it's not possible to move the file to my server.
I get this error
Code: Select all
<this>: {…}
arguments: Arguments
data: "{\"status\":\"error\",\"error\":\"ERROR_MOVING_FILE\"}"
err: undefined
result: undefined
data: "{\"status\":\"error\",\"error\":\"ERROR_MOVING_FILE\"}"
err: "The file cannot be moved to the destination directory."
result: {…}
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: upload file to server
You could also try setting the variable to "document root" / nuBuilder root dir (and create there a documents folder)
$uploaddir = $_SERVER['DOCUMENT_ROOT']."/documents/";
$uploaddir = $_SERVER['DOCUMENT_ROOT']."/documents/";
Re: upload file to server
Kev1n
changed $uploaddir = './documents/' to $uploaddir = './documents' and now the upload works.
But my file is saved in folder upload not in folder documents.
When I try to reopen the file it points to the wrong url (in documents)
Johan
changed $uploaddir = './documents/' to $uploaddir = './documents' and now the upload works.
But my file is saved in folder upload not in folder documents.
When I try to reopen the file it points to the wrong url (in documents)
Johan
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: upload file to server
Use the latest upload.php file
https://github.com/smalos/nubuilder-cod ... upload.php
and try setting the upload directory to
https://github.com/smalos/nubuilder-cod ... upload.php
and try setting the upload directory to
Code: Select all
$uploaddir = $_SERVER['DOCUMENT_ROOT']."/libs/upload/documents/";
Re: upload file to server
Kev1n
With the new script it works fine. Thanks for your help.
Just 1 suggestion?
Is it possible to remove the file from the server when deleted in Nubuilder?
Johan
With the new script it works fine. Thanks for your help.
Just 1 suggestion?
Is it possible to remove the file from the server when deleted in Nubuilder?
Johan
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: upload file to server
Kev1n
Just when I delete a subrow containing a file.
Than the row is deleted in de sql table.
Johan
Just when I delete a subrow containing a file.
Than the row is deleted in de sql table.
Johan