I want to make a web-program where an user click a button, choose an image and it is uploaded to a server/web/cloud. Just one per click.
Something like "Welcome! Press HERE to upload a photo!"
Where I am lost is about the upload process itself, how to do it.
Later, another program (an .exe on a computer) will check the web/cloud/server for new photos uploaded and download them, but first I have to solve the upload
How do I upload images?
Re: How do I upload images?
Hi,
you need two codes, one for the client and one for the server.
For the client side you can find sample codes for SB here in the forums, for example this:
viewtopic.php?f=9&t=1929
For the server side to store the uploaded file you could use a simple php script. This is not too difficult. Have a look here:
https://www.w3schools.com/php/php_file_upload.asp
you need two codes, one for the client and one for the server.
For the client side you can find sample codes for SB here in the forums, for example this:
viewtopic.php?f=9&t=1929
For the server side to store the uploaded file you could use a simple php script. This is not too difficult. Have a look here:
https://www.w3schools.com/php/php_file_upload.asp
Re: How do I upload images?
Thank you for the help.
With the w3school example, I have been able to upload photos.
I have tried the example at viewtopic.php?f=9&t=1929 but the SpideBasic program seems to sent an empty string to upload.php file
Any hint/help?
With the w3school example, I have been able to upload photos.
I have tried the example at viewtopic.php?f=9&t=1929 but the SpideBasic program seems to sent an empty string to upload.php file
Any hint/help?
Re: How do I upload images?
changing this lineAMpos wrote:With the w3school example, I have been able to upload photos.
I have tried the example at viewtopic.php?f=9&t=1929 but the SpideBasic program seems to sent an empty string to upload.php file
Any hint/help?
Code: Select all
! formData.append('file', v_filetoupload);
Code: Select all
! formData.append('fileToUpload', v_filetoupload);
P.S.: there is no reason to post your questions in two threads at the same time
Re: How do I upload images?
I love you! it works
Re: How do I upload images?
So, as SpiderBasic code I am using the code from
viewtopic.php?f=9&t=1929
and as upload.php the one from
https://www.w3schools.com/php/php_file_upload.asp
Is there a way to know if the file was uploaded or not, from SpiderBasic?
viewtopic.php?f=9&t=1929
and as upload.php the one from
https://www.w3schools.com/php/php_file_upload.asp
Is there a way to know if the file was uploaded or not, from SpiderBasic?
Re: How do I upload images?
take a look at the UploadFileCallback() in my code.AMpos wrote:Is there a way to know if the file was uploaded or not, from SpiderBasic?