Jump to content

cURL and $_FILES working on Windows but not Linux...


rayman0487

Recommended Posts

Hey all. I have an issue that I cannot figure out today and it's driving me crazy. I have an API and a front-end application running on my Windows PC and my LAMP on AWS and I'm trying to upload a file from the front end to the API for the API to handle saving the file. On my window's machine it works fine, but on AWS it is not working, it is "changing" my array structure. For example see the simple debug output below:

 

WINDOWS:

Sending:
Array
(   [request] => UploadFile
    [CustomerID] => 1
    [Category] => 1
    [0] => @D:\Programs\xampp\CSTemp\1\1\home.txt
)

API STARTING...
1 files submitted
File Array: 
Array
(
    [0] => Array
        (
            [name] => home.txt
            [type] => application/octet-stream
            [tmp_name] => D:\Programs\xampp\tmp\phpC4B2.tmp
            [error] => 0
            [size] => 0
        )
)

LINUX

Sending:
Array
(   [request] => UploadFile
    [CustomerID] => 1
    [Category] => 1
    [0] => @/var/www/tmp/1/1/home.txt
)

API STARTING...
1 files submitted
File Array: 
Array
(
    [Category] => Array
        (
            [name] => home.txt
            [type] => application/octet-stream
            [tmp_name] => /tmp/php1DBdoV
            [error] => 0
            [size] => 0
        )
)

As you can see, Linux is storing the file in $_FILES['Category'] and not just $_FILES which Windows is doing. I know the source code is exactly the same because I'm working from a SVN repository that automatically checks out the source code on AWS when I commit from my computer.

 

Does anyone have any insight into this? I can provide additional code if needed, but the code appears to be working other than this issues..

 

Thanks for you help.

 

-R

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.