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 168703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:30:00+00:00 2026-05-11T12:30:00+00:00

I have been unsuccesfully attempting to upload an encrypted file to an FTP server,

  • 0

I have been unsuccesfully attempting to upload an encrypted file to an FTP server, without writing it to the filesystem first (which has security implications)

I have been attempting to use proc_open and then ftp_fput but to no avail, I guess because the stream created in proc_open isn’t fstatable

Here is the code

<?php $ciphertext = 'sadfasfasdf90809sf890as8fjwkjlf';  //The Descriptors $descriptorspec = array(    0 => array('pipe', 'r'),  // stdin    1 => array('pipe', 'w'),  // stdout    2 => array('pipe', 'w')   // error );  $process = proc_open('cat', $descriptorspec, $pipes); if (is_resource($process)) {     fwrite($pipes[0], $ciphertext);  fclose($pipes[0]);  //Debug test to proce that $pipes[1] is a valid stream      //while(!feof($pipes[1])) { //  $content .=  fgets($pipes[1],1024); //}  //FTP connection etc etc OMMITTED to save space.  $upload = @ftp_fput($conn_id,$dir.'/'.$ftp_file.$extenstion,$pipes[1],FTP_BINARY); fclose($pipes[1]); // Check upload status echo ('upload '. ($upload ? 'true':' false'));  } ?>  

I hope someone can help or suggest any improvements or alternative methods.

Thanks,

Phil

  • 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. 2026-05-11T12:30:01+00:00Added an answer on May 11, 2026 at 12:30 pm

    Never trust a server admin!

    The code above works and doesn’t require you to use a tmpfile.

    Thanks,

    Phil

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

Sidebar

Related Questions

Have been reading about async and tasks and been attempting to convert the CopyFileEx
I have been struggling to create a django form which users can fill and
I need to find files which have been in the folder Wastebasket exactly one
Have been writing the shell script such as : #! /bin/bash `sqlplus -s <username>/<passwd>@dbname`
have been playing with Cubepoints (wordpress plugin) and have installed the ranks module but
Have been working on this question for a couple hours and have come close
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
Have been searching how to convert a dictionary to a string. But the results
Have have been trying to make a validator for my xml files. I have
I have been trying this for the whole day and I managed to make

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.