How can I upload a file without file dialog

I want to send about 3M data to server,and I save it to a file so I know
every thing about the file.Now how can I upload the file without file
field