Different result when using mobile than PC
up vote
1
down vote
favorite
First of all i want to thank you for spending time reading this post. I am quite new to programming and i am learning ALOT. Sorry in advance for my incompetence.
Currently working on a webapp. This app has the function to basicly access the file system, and then upload the file selected. When clicking the upload button i have created, i get different results depending on weather or not im using PC or my iPhone.
When clicking the button on my iPhone the photo will be submitted to my storage on google cloud, but it will redirect me to the link of the picture.
On PC it does not redirect, and it still manages to upload the picture like it should.
I have an idea of when this problem occurs, i think it happens when submitting the form? The phone does not redirect back to the original page.
How do i get the iPhone result to be the same as my PC, so it doesnt redirect and stay on the page of my picture.
Also, all my code is in correct tags, i just copy pasted it into this website without script tags etc, cause there is a bunch of other code irrelevant to this one i had to manuever around.
<form id="BilledeUpload" action="" method="POST" enctype="multipart/form-data">
<input type="file"accept="image/*" name="file"class="">
<button form="BilledeUpload" name ="SendpictoDBbtn"onclick="indsaetIdb()">Upload</button>
</form>
function indsaetIdb(){
let randomnummer = Math.floor(Math.random()*999999999)+1;
var billedenavn = document.getElementById("BilledeUpload");
var url = "https://storage.googleapis.com/randombucketname/nottoday/"+randomnummer
document.cookie="linket="+url;
//document.getElementById("BilledeUpload").reset();
console.log(findCookieBeskrivelse("linket"));
}
javascript html
|
show 4 more comments
up vote
1
down vote
favorite
First of all i want to thank you for spending time reading this post. I am quite new to programming and i am learning ALOT. Sorry in advance for my incompetence.
Currently working on a webapp. This app has the function to basicly access the file system, and then upload the file selected. When clicking the upload button i have created, i get different results depending on weather or not im using PC or my iPhone.
When clicking the button on my iPhone the photo will be submitted to my storage on google cloud, but it will redirect me to the link of the picture.
On PC it does not redirect, and it still manages to upload the picture like it should.
I have an idea of when this problem occurs, i think it happens when submitting the form? The phone does not redirect back to the original page.
How do i get the iPhone result to be the same as my PC, so it doesnt redirect and stay on the page of my picture.
Also, all my code is in correct tags, i just copy pasted it into this website without script tags etc, cause there is a bunch of other code irrelevant to this one i had to manuever around.
<form id="BilledeUpload" action="" method="POST" enctype="multipart/form-data">
<input type="file"accept="image/*" name="file"class="">
<button form="BilledeUpload" name ="SendpictoDBbtn"onclick="indsaetIdb()">Upload</button>
</form>
function indsaetIdb(){
let randomnummer = Math.floor(Math.random()*999999999)+1;
var billedenavn = document.getElementById("BilledeUpload");
var url = "https://storage.googleapis.com/randombucketname/nottoday/"+randomnummer
document.cookie="linket="+url;
//document.getElementById("BilledeUpload").reset();
console.log(findCookieBeskrivelse("linket"));
}
javascript html
Could you open browser console(F12) and check is there any errors or warnings? And btw check onclick method in your code there are no space between name and onclick handler if it's not a typo.
– Ishikawa Yoshi
Nov 13 at 12:16
Unfortunately im not able to open the console on my phone, as this problem only happens on my phone. No typos i have quadruple checked my code at this point. It works flawless on PC just not on phone, and i have no idea why.
– Mathias Bruun Hemmingsen
Nov 13 at 12:18
You can debug your phone Chrome browser via PC check this developers.google.com/web/tools/chrome-devtools/…
– Ishikawa Yoshi
Nov 13 at 12:21
1
name ="SendpictoDBbtn"onclick="indsaetIdb()" i mean this one, you should add space between name ="SendpictoDBbtn" onclick="indsaetIdb()"
– Ishikawa Yoshi
Nov 13 at 12:26
1
That’s not what I meant. If you submit this to your own server first, then you must have implemented logic there that then sends this data to your cloud storage - so where is that code? Maybe what goes “wrong”, goes wrong in that part? The redirect to the “link of the picture” might originate there …
– misorude
Nov 13 at 12:51
|
show 4 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
First of all i want to thank you for spending time reading this post. I am quite new to programming and i am learning ALOT. Sorry in advance for my incompetence.
Currently working on a webapp. This app has the function to basicly access the file system, and then upload the file selected. When clicking the upload button i have created, i get different results depending on weather or not im using PC or my iPhone.
When clicking the button on my iPhone the photo will be submitted to my storage on google cloud, but it will redirect me to the link of the picture.
On PC it does not redirect, and it still manages to upload the picture like it should.
I have an idea of when this problem occurs, i think it happens when submitting the form? The phone does not redirect back to the original page.
How do i get the iPhone result to be the same as my PC, so it doesnt redirect and stay on the page of my picture.
Also, all my code is in correct tags, i just copy pasted it into this website without script tags etc, cause there is a bunch of other code irrelevant to this one i had to manuever around.
<form id="BilledeUpload" action="" method="POST" enctype="multipart/form-data">
<input type="file"accept="image/*" name="file"class="">
<button form="BilledeUpload" name ="SendpictoDBbtn"onclick="indsaetIdb()">Upload</button>
</form>
function indsaetIdb(){
let randomnummer = Math.floor(Math.random()*999999999)+1;
var billedenavn = document.getElementById("BilledeUpload");
var url = "https://storage.googleapis.com/randombucketname/nottoday/"+randomnummer
document.cookie="linket="+url;
//document.getElementById("BilledeUpload").reset();
console.log(findCookieBeskrivelse("linket"));
}
javascript html
First of all i want to thank you for spending time reading this post. I am quite new to programming and i am learning ALOT. Sorry in advance for my incompetence.
Currently working on a webapp. This app has the function to basicly access the file system, and then upload the file selected. When clicking the upload button i have created, i get different results depending on weather or not im using PC or my iPhone.
When clicking the button on my iPhone the photo will be submitted to my storage on google cloud, but it will redirect me to the link of the picture.
On PC it does not redirect, and it still manages to upload the picture like it should.
I have an idea of when this problem occurs, i think it happens when submitting the form? The phone does not redirect back to the original page.
How do i get the iPhone result to be the same as my PC, so it doesnt redirect and stay on the page of my picture.
Also, all my code is in correct tags, i just copy pasted it into this website without script tags etc, cause there is a bunch of other code irrelevant to this one i had to manuever around.
<form id="BilledeUpload" action="" method="POST" enctype="multipart/form-data">
<input type="file"accept="image/*" name="file"class="">
<button form="BilledeUpload" name ="SendpictoDBbtn"onclick="indsaetIdb()">Upload</button>
</form>
function indsaetIdb(){
let randomnummer = Math.floor(Math.random()*999999999)+1;
var billedenavn = document.getElementById("BilledeUpload");
var url = "https://storage.googleapis.com/randombucketname/nottoday/"+randomnummer
document.cookie="linket="+url;
//document.getElementById("BilledeUpload").reset();
console.log(findCookieBeskrivelse("linket"));
}
javascript html
javascript html
edited Nov 13 at 12:22
asked Nov 13 at 12:04
Mathias Bruun Hemmingsen
234
234
Could you open browser console(F12) and check is there any errors or warnings? And btw check onclick method in your code there are no space between name and onclick handler if it's not a typo.
– Ishikawa Yoshi
Nov 13 at 12:16
Unfortunately im not able to open the console on my phone, as this problem only happens on my phone. No typos i have quadruple checked my code at this point. It works flawless on PC just not on phone, and i have no idea why.
– Mathias Bruun Hemmingsen
Nov 13 at 12:18
You can debug your phone Chrome browser via PC check this developers.google.com/web/tools/chrome-devtools/…
– Ishikawa Yoshi
Nov 13 at 12:21
1
name ="SendpictoDBbtn"onclick="indsaetIdb()" i mean this one, you should add space between name ="SendpictoDBbtn" onclick="indsaetIdb()"
– Ishikawa Yoshi
Nov 13 at 12:26
1
That’s not what I meant. If you submit this to your own server first, then you must have implemented logic there that then sends this data to your cloud storage - so where is that code? Maybe what goes “wrong”, goes wrong in that part? The redirect to the “link of the picture” might originate there …
– misorude
Nov 13 at 12:51
|
show 4 more comments
Could you open browser console(F12) and check is there any errors or warnings? And btw check onclick method in your code there are no space between name and onclick handler if it's not a typo.
– Ishikawa Yoshi
Nov 13 at 12:16
Unfortunately im not able to open the console on my phone, as this problem only happens on my phone. No typos i have quadruple checked my code at this point. It works flawless on PC just not on phone, and i have no idea why.
– Mathias Bruun Hemmingsen
Nov 13 at 12:18
You can debug your phone Chrome browser via PC check this developers.google.com/web/tools/chrome-devtools/…
– Ishikawa Yoshi
Nov 13 at 12:21
1
name ="SendpictoDBbtn"onclick="indsaetIdb()" i mean this one, you should add space between name ="SendpictoDBbtn" onclick="indsaetIdb()"
– Ishikawa Yoshi
Nov 13 at 12:26
1
That’s not what I meant. If you submit this to your own server first, then you must have implemented logic there that then sends this data to your cloud storage - so where is that code? Maybe what goes “wrong”, goes wrong in that part? The redirect to the “link of the picture” might originate there …
– misorude
Nov 13 at 12:51
Could you open browser console(F12) and check is there any errors or warnings? And btw check onclick method in your code there are no space between name and onclick handler if it's not a typo.
– Ishikawa Yoshi
Nov 13 at 12:16
Could you open browser console(F12) and check is there any errors or warnings? And btw check onclick method in your code there are no space between name and onclick handler if it's not a typo.
– Ishikawa Yoshi
Nov 13 at 12:16
Unfortunately im not able to open the console on my phone, as this problem only happens on my phone. No typos i have quadruple checked my code at this point. It works flawless on PC just not on phone, and i have no idea why.
– Mathias Bruun Hemmingsen
Nov 13 at 12:18
Unfortunately im not able to open the console on my phone, as this problem only happens on my phone. No typos i have quadruple checked my code at this point. It works flawless on PC just not on phone, and i have no idea why.
– Mathias Bruun Hemmingsen
Nov 13 at 12:18
You can debug your phone Chrome browser via PC check this developers.google.com/web/tools/chrome-devtools/…
– Ishikawa Yoshi
Nov 13 at 12:21
You can debug your phone Chrome browser via PC check this developers.google.com/web/tools/chrome-devtools/…
– Ishikawa Yoshi
Nov 13 at 12:21
1
1
name ="SendpictoDBbtn"onclick="indsaetIdb()" i mean this one, you should add space between name ="SendpictoDBbtn" onclick="indsaetIdb()"
– Ishikawa Yoshi
Nov 13 at 12:26
name ="SendpictoDBbtn"onclick="indsaetIdb()" i mean this one, you should add space between name ="SendpictoDBbtn" onclick="indsaetIdb()"
– Ishikawa Yoshi
Nov 13 at 12:26
1
1
That’s not what I meant. If you submit this to your own server first, then you must have implemented logic there that then sends this data to your cloud storage - so where is that code? Maybe what goes “wrong”, goes wrong in that part? The redirect to the “link of the picture” might originate there …
– misorude
Nov 13 at 12:51
That’s not what I meant. If you submit this to your own server first, then you must have implemented logic there that then sends this data to your cloud storage - so where is that code? Maybe what goes “wrong”, goes wrong in that part? The redirect to the “link of the picture” might originate there …
– misorude
Nov 13 at 12:51
|
show 4 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280669%2fdifferent-result-when-using-mobile-than-pc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you open browser console(F12) and check is there any errors or warnings? And btw check onclick method in your code there are no space between name and onclick handler if it's not a typo.
– Ishikawa Yoshi
Nov 13 at 12:16
Unfortunately im not able to open the console on my phone, as this problem only happens on my phone. No typos i have quadruple checked my code at this point. It works flawless on PC just not on phone, and i have no idea why.
– Mathias Bruun Hemmingsen
Nov 13 at 12:18
You can debug your phone Chrome browser via PC check this developers.google.com/web/tools/chrome-devtools/…
– Ishikawa Yoshi
Nov 13 at 12:21
1
name ="SendpictoDBbtn"onclick="indsaetIdb()" i mean this one, you should add space between name ="SendpictoDBbtn" onclick="indsaetIdb()"
– Ishikawa Yoshi
Nov 13 at 12:26
1
That’s not what I meant. If you submit this to your own server first, then you must have implemented logic there that then sends this data to your cloud storage - so where is that code? Maybe what goes “wrong”, goes wrong in that part? The redirect to the “link of the picture” might originate there …
– misorude
Nov 13 at 12:51