Different result when using mobile than PC
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
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 '18 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 '18 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 '18 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 '18 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 '18 at 12:51
|
show 4 more comments
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 '18 at 12:22
Mathias Bruun Hemmingsen
asked Nov 13 '18 at 12:04
Mathias Bruun HemmingsenMathias Bruun Hemmingsen
244
244
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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 at 12:26
name ="SendpictoDBbtn"onclick="indsaetIdb()" i mean this one, you should add space between name ="SendpictoDBbtn" onclick="indsaetIdb()"
– Ishikawa Yoshi
Nov 13 '18 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 '18 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 '18 at 12:51
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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 '18 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 '18 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 '18 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 '18 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 '18 at 12:51