tschoffelen / php-pkpass

💳 PHP class for creating passes for Wallet on iOS.
https://includable.com
MIT License
916 stars 186 forks source link

Mobile Chrome and Edge #90

Closed Shinichi-Marumoto closed 5 years ago

Shinichi-Marumoto commented 5 years ago

Expected Behavior

Mobile Chrome and Edge create two tmp directories and files. There is no problem with mobile-safari.

Actual Behavior

At this part -> The first tmp directory is exists. header('Content-Description: File Transfer'); At this part -> The second tmp directory is created. header('Content-Type: application/vnd.apple.pkpass');

Steps to Reproduce the Problem

  1. I insert post data.

    $_name = isset($_POST['name'])?$_POST['name']:'NONE';
    'primaryFields' => [
            [
                'key' => 'name',
                'label' => 'Name',
                'value' => $_name,
            ],
  2. In the first file, $_POST['name'] is inserted, and in the second file, NONE is inserted.

  3. And B is downloaded.

tschoffelen commented 5 years ago

I'm not sure if I fully understand.

Is there any way for you to send me your script so I can try to reproduce the problem? If you don't wish to share it publicly, you can always email me using the email address in my Github profile.

tschoffelen commented 5 years ago

Thanks for emailing the test code. I still don't think I fully understand the problem.

Does the script create multiple different temporary directories on your server?

Shinichi-Marumoto commented 5 years ago

Thank you for your reply

No problem with mobile-safari.

Mobile-edge and mobile-chrome created two temporary directories. And the files in the first directory created contain the values I entered in the form. But The file in the second directory created does not contain the values I entered in the form. And the second file created will be output as a pkpass.

2019年7月1日(月) 16:09 Thomas Schoffelen notifications@github.com:

Thanks for emailing the test code. I still don't think I fully understand the problem.

Does the script create multiple different temporary directories on your server?

tschoffelen commented 5 years ago

This seems to be caused by the form submitting twice.

The script creates only one tmp directory per request, and the browser can't have any influence on that because it happens server-side.

Two things to try:

Shinichi-Marumoto commented 5 years ago

Thank you for your reply.

It did not work out.

2019年7月1日(月) 18:17 Thomas Schoffelen notifications@github.com:

This seems to be caused by the form submitting twice.

The script creates only one tmp directory per request, and the browser can't have any influence on that because it happens server-side.

Two things to try:

  • Update the
  • Add JS code to disable the button once pressed so it can't be submitted twice.
Shinichi-Marumoto commented 5 years ago

Thank you so very much. The problem is solved. It solved by using Get-Send instead of Post-Send.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.