Thread: File upload

  1. #1
    Registered User
    Join Date
    Jun 2016
    Posts
    2

    File upload

    Hey I was playing around with a C++ program that I could send to them and if they ran it it would send me a file on their computer. Possibly though gmail? Nothing online is helping. Im useing dev-c++

    Does anyone know how I can do it?

    Edit----
    I would like the program to send the file discreetly without any detection and maybe delete itself when finished.
    Last edited by unAlike; 06-21-2016 at 12:13 PM.

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    It's not clear to me if you actually need help with network programming or gmail.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    It certainly is possible to write a C++ program to send an email with an attachment. It sounds like that's all to your program, other than code for the desired file to be selected. I presume that this is merely an exercise to practise network programming; it'll be easier to have the other party simply send you an email!

    Quote Originally Posted by unAlike
    Nothing online is helping.
    What search terms did you use? I searched for "C++ email" and was rewarded with quite a few promising results.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Jun 2016
    Posts
    2
    I did attempt almost every example shown on those sites but none of them worked. They all threw errors and I was unable to fix them because I know little to nothing about socket programaming.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Ah. Why not start by learning socket programming then?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Look into the Poco C++ Libraries. They have tools to send emails with attachments. I use them in some of my code, and I am really impressed with the quality and functionality of the software.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > I would like the program to send the file discreetly without any detection and maybe delete itself when finished.
    Put a big neon sign on it which says spyware.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File Upload Security Tips
    By MutantJohn in forum Tech Board
    Replies: 31
    Last Post: 09-06-2015, 10:01 AM
  2. HTTP File Upload Libcurl
    By binks in forum Networking/Device Communication
    Replies: 19
    Last Post: 07-21-2011, 06:16 PM
  3. file upload form in c++
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-17-2008, 01:13 PM
  4. File Upload with libcurl
    By Tonto in forum Networking/Device Communication
    Replies: 4
    Last Post: 03-15-2006, 06:11 PM
  5. Anyone know a good file upload routine.
    By bjdea1 in forum C Programming
    Replies: 2
    Last Post: 12-08-2001, 12:04 PM

Tags for this Thread