Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:26:58+00:00 2026-06-15T10:26:58+00:00

I am working on a school project which involves a Supermarket system and I

  • 0

I am working on a school project which involves a Supermarket system and I have a Shop PC (localhost) and a HQ server (hosted on Amazon EC2). One of the requirements is that Shop PC will generate a transaction file (I have a button which generates the file) and that text file needs to be sent over to the HQ server. I have created a folder with 777 permissions on the HQ server. I was trying to simply send over/upload the file to that folder using the copy function of PHP but that does not work. Any clues on how I can do that? I do not have ftp installed on amazon and cannot do that as per the requirements.

Also, i cannot create an upload form (multipart form?) on the HQ admim to upload the file because the shop guy can’t access the HQ server pages.

The address of the folder where the files need to be uploaded is:

"site address"/uploads

I create the transaction file in the following manner:

$ourFileName = "transaction.txt";
    $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
    //fwrite($fh, $stringData);

    $sql = mysql_query("the query");

    while($row=mysql_fetch_array($sql)){
        $stringData = "data";
        fwrite($ourFileHandle, $stringData);
    }

    fclose($ourFileHandle);

This file is created on the shop PC and i want to send it to the HQ server, where it can be parsed and added to the HQ database. To the send the file to the uploads folder in the HQ sever, i follow the above code with:

$filename = "news.txt";
    $newfile = "siteaddress/uploads/" . $filename;
    if(copy($ourFileName, $newfile)) 
    {
    print("<h3> UPLOAD SUCCESSFUL!</h3>");
    } 
    else
    {
    print("<h3>ERROR UPLOADING FILE!</h3>");
    }

Edit after following the discussions:

The HQ server has php. Infact it has a file parser defined in parse_transaction.php which begins like:

<?php
include "../storescripts/connect_to_mysql_HQ.php"; 
mysql_query($sql);
mysql_query($sql2);
mysql_query($sql3);

$filename= mysql_real_escape_string($_FILES["file"]["tmp_name"]);

$lines = file($filename); // slurp file and split into an array by lines

perhaps somehow possible to send the transaction file directly here for parsing and updating without storing it in the uploads folder?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:26:58+00:00Added an answer on June 15, 2026 at 10:26 am

    Does the file get transferred with the wrong write/read/execute attributes or not at all?

    If the file does not get transferred have you checked for php log errors?

    If you are using copy, then i assume you have the partition mounted so you have direct access to the files on the HQ server, if not you could try setting up your php for receiving files, take a look at this:

    http://php.net/manual/en/features.file-upload.post-method.php
    

    And if you don’t have php on the server, how do you access its files?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a school project which involves managing driving instructor calendars. The
In a school project, I have implemented a working syncadapter for syncing contacts with
im working on a simple C++ HTTP server as a school project and I
My team working on a php/MySQL website for a school project. I have a
Set up and Explanation : I'm working on a project for school, and have
I am currently working on a project for school which will be a webapp
I'm working on a school project which is to create an GPS for an
I'm working on a school project which should give students the ability to search
I'm working on a school project in which we would like to analyze the
I am working on a Reverse Engineering school project, which requires to translate manipulate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.