The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Url file uploader with javascript
The_webmaster
post Feb 21 2021, 08:48 AM
Post #1


Novice
**

Group: Members
Posts: 28
Joined: 5-February 21
Member No.: 27,773



Please i want to make a url uploader and get the download link with javascrip, Please can any one help me
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 21 2021, 09:18 AM
Post #2


Computer says no 🌟
********

Group: WDG Moderators
Posts: 19,531
Joined: 9-August 06
Member No.: 6



What's a URL uploader?
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_webmaster
post Feb 21 2021, 10:19 AM
Post #3


Novice
**

Group: Members
Posts: 28
Joined: 5-February 21
Member No.: 27,773



A url uploader is just an input where you can write file url/link an it will import the file that has the url
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 21 2021, 12:38 PM
Post #4


Computer says no 🌟
********

Group: WDG Moderators
Posts: 19,531
Joined: 9-August 06
Member No.: 6



So you want to upload a file to your server from another site? It won't happen with JavaScript. You need something server side.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_webmaster
post Feb 22 2021, 05:42 AM
Post #5


Novice
**

Group: Members
Posts: 28
Joined: 5-February 21
Member No.: 27,773



but it works with php
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 22 2021, 08:19 AM
Post #6


.
********

Group: WDG Moderators
Posts: 8,731
Joined: 10-August 06
Member No.: 7



QUOTE(The_webmaster @ Feb 22 2021, 11:42 AM) *

but it works with php

That's correct, see: https://www.php.net/manual/en/features.file-upload.php
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 22 2021, 08:36 AM
Post #7


Computer says no 🌟
********

Group: WDG Moderators
Posts: 19,531
Joined: 9-August 06
Member No.: 6



Yeah. You mean that means it should work with JavaScript too? It doesn't. JavaScript is limited by a lot of security restrictions. It doesn't have access to the server.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 22 2021, 01:09 PM
Post #8


.
********

Group: WDG Moderators
Posts: 8,731
Joined: 10-August 06
Member No.: 7



@The_webmaster, a file upload requires three steps:

1. The browser and file upload HTML page let the user choose a file on his own computer. As far as I know this can only be done with the <input type="file"> element, because of security restrictions. Javascript is not allowed to view the user's file system.

2. The chosen file is sent to the web page's server. This can be done with javascript (using Ajax), but it's usually better to keep it simple and use an HTML form.

3. A server-side script on the server receives the file and saves it to the web server. There are many different server-side scripting languages, such as PHP, Perl, Python, Java.

QUOTE(pandy @ Feb 22 2021, 02:36 PM) *

JavaScript is limited by a lot of security restrictions. It doesn't have access to the server.

As a sidenote you can actually install a javascript engine on a server too, but that's of course completely separate from the internal javascript engine in the user's browser, which only interprets the javascript on HTML pages.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_webmaster
post Feb 22 2021, 03:33 PM
Post #9


Novice
**

Group: Members
Posts: 28
Joined: 5-February 21
Member No.: 27,773



Thanks everyone for your reply
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th February 2021 - 03:57 PM