JSON problem on Supervideo.tv remote upload app


Joined
Feb 19, 2020
Messages
22
Reaction score
0
Hi,

I developed this app to remote upload videos to Supervideo.tv but i'm having problems with uploads. I'm getting CORS issues. Can anyone view the source and tell me what's the issue?

Code:
<html>
<title>Supervideo.tv Remote Upload APP</title>
<center>
<p>File Location : <input type="text" id="filelocation"> <input type="submit" name="submit" value="Upload!" onclick="start()"><br><br><font size="-2">A APP to remote upload videos to Supervideo.tv</font></p>
</center>
<script>
function start(){
var filelocation = escape(document.getElementById('filelocation').value);
if (filelocation == "") {alert('Type a video link'); return false;}
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText);
document.write('<center><br><br>https://supervideo.tv/'+ myObj.result.filecode +'</center>');
}
};
xmlhttp.open("GET", "https://supervideo.tv/api/upload/url?key=1149wr982foddk898vzx&url="+filelocation+"&adult=0", true);
xmlhttp.send();
}
</script>

Thanks
 
Ad

Advertisements

Joined
Nov 27, 2019
Messages
129
Reaction score
19
Quick reply:
The escape() function was deprecated in JavaScript version 1.5. Use encodeURI() or encodeURIComponent() instead.
AND
document.write() destroys the HTML you have on the browser. use
document.getElementById("demo").innerHTML and make that element in the HTML.
 
Joined
Nov 27, 2019
Messages
129
Reaction score
19
CORS issues => but no message. CORS always gives a messages as to why things didn't work.
OK, I says, I'll just try this myself. SO went to https://supervideo.tv/ and then tried to set up account and got this:
NOTE: We are not fully free video hosting service. If you don't have traffic to send us, please don't use our service.
This might be the reason for failure. No way I could know.
CORS by the way comes from your browser and it highly possible that the site does not support or supports improperly the CORS requests. Check with the site.

What you need to do in the mean time is see what headers you are sending and which are killing the process.

ALERT: since this did not work for me at all, I think the problem lies with SuperVideo.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top