Sponsored Content
Full Discussion: Shell Imgur upload with curl
Top Forums UNIX for Dummies Questions & Answers Shell Imgur upload with curl Post 302574596 by slashdotweenie on Friday 18th of November 2011 11:43:26 AM
Old 11-18-2011
Code:
> wget -nd http://i.imgur.com/j2MJj.png
--2011-11-17 22:42:59--  http://i.imgur.com/j2MJj.png
Resolving i.imgur.com (i.imgur.com)... 93.184.221.133
Connecting to i.imgur.com (i.imgur.com)|93.184.221.133|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 489 [image/png]
Saving to: `j2MJj.png'

100%[=========================================================================================================================================================================================>] 489         --.-K/s   in 0s      

2011-11-17 23:12:59 (38.9 MB/s) - `j2MJj.png' saved [489/489]

looks valid

Code:
> file j2MJj.png 
j2MJj.png: PNG image data, 30 x 15, 8-bit grayscale, non-interlaced

very small file 489 Bits

Code:
> ls -al j2MJj.png 
-rw-r--r--  1 jonny  wheel  489 Nov 17 21:45 j2MJj.png
> ls -alh j2MJj.png 
-rw-r--r--  1 jonny  wheel   489B Nov 17 21:45 j2MJj.png

uploaded file

Code:
> ls -alh test.mp4.jpeg 
-rw-r--r--  1 jonny  staff   453K Nov 17 19:16 test.mp4.jpeg
> ls -al test.mp4.jpeg 
-rw-r--r--  1 jonny  staff  463958 Nov 17 19:16 test.mp4.jpeg

---------- Post updated at 04:55 PM ---------- Previous update was at 04:50 PM ----------

I tried with several different image files. But always the same garbage at imgur.com

---------- Post updated 11-18-11 at 11:43 AM ---------- Previous update was 11-17-11 at 04:55 PM ----------

that also doesn't work - no Imgur URL

Code:
 imgur < test.mp4.jpeg 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   576    0   258  100   318    576    710 --:--:-- --:--:-- --:--:--   940

Code:
> grep imgur .bashrc 
imgur(){ $*|curl -F "image=@-" -F "key=1913b4ac473c692372d108209958fd15" http://api.imgur.com/2/upload.xml|grep -Eo "<original>(.)*</original>" | grep -Eo "http://i.imgur.com/[^<]*";}

no other idea?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Shell Script to upload data from Text file to Oracle database

Hi Does any one have any idea on uploading the data using Unix Shell script from text file to Oracle database. Requirement:- 1. Need to connect to Oracle database from Unix Shell script. 2. Need to pick Text file from some location on Unix Box. 3. Need to upload the data from text file to... (6 Replies)
Discussion started by: chandrashekharj
6 Replies

2. Shell Programming and Scripting

using curl with shell script.

hi please help me out here, i want to use curl command in shell script to test web pages, what i have is an opening page, when i click on a button on opening page, the next page comes up and then i have to upload a file n then click another button to submit and then comes the output... (0 Replies)
Discussion started by: ankushg002
0 Replies

3. Shell Programming and Scripting

ftp put in shell script -- whole file doesn't upload

Hi I'm having some trouble with a bash shell script that I'm writing. In the script, I'm trying to upload a file to a backup repository using ftp, but the whole file doesn't get uploaded. This is the file's properties at the start (I've highlighted the file size in red): -rw-r--r-- 1 root... (2 Replies)
Discussion started by: Viola
2 Replies

4. Shell Programming and Scripting

Shell Script to monitor folder and upload found files via FTP

Hi everyone! I'm in a need of a shell script that search for all files in a folder, move all those files to a temp folder, and upload those files via FTP. When the file transfer via FTP completes successfully, the file is moved to a completed folder. In case any of those files fails, the file... (4 Replies)
Discussion started by: pulsorock
4 Replies

5. Shell Programming and Scripting

Shell Script for Upload/download files using cURL

hi please help me out here, i want to use curl command in shell script to test web pages, what i have is an opening page, when i click on a button on opening page, the next page comes up and then i have to upload a file n then click another button to submit and then comes the output page,... (2 Replies)
Discussion started by: Olivia
2 Replies

6. Shell Programming and Scripting

File upload through curl

hi; I need a script to upload a file using HTTP(curl post) to another system. Will appreciate ur help. Thnks; (0 Replies)
Discussion started by: ajaypadvi
0 Replies

7. Shell Programming and Scripting

Curl ftp upload success but no file exist on the server !!!!

hello, I'm trying to upload a file to this ftp server and others ftp://ftp.byethost12.com as you can see in the output of CURL using the -v option curl reports that the upload succeeded but when i connected to the server with file-zilla there is no file uploaded the same command upload files... (5 Replies)
Discussion started by: laraaj
5 Replies

8. Shell Programming and Scripting

HTML code upload text file grep through shell script

I am looking for HTML code that browse text file and grep with database file then retrieve result txtfileuploaded contain 112233 115599 113366 shell code grep -F -f txtfileuploaded /data/database.txt result 112233 Mar 41$ 115599 Nov 44$ 113366 Oct 33$ attached... (2 Replies)
Discussion started by: phpshell
2 Replies

9. Shell Programming and Scripting

FTP in shell script and selecting files for upload

Hi, Im a newbie with programming and shell scripting. Im running OSX/Mac and Darwin. I would like to create a shell script that would : 1. Search a Volume and directory (including subdirectories) for a file that : * filename ends with ”_Highres.pdf” and * the file creation date of... (8 Replies)
Discussion started by: NickeZ28
8 Replies

10. Shell Programming and Scripting

Curl - upload multiple attachment arrays to server webpage

The html page of the form data is as below <form name="uploadform" id="uploadform" action="htmlupload.php" enctype="multipart/form-data" method="post"> <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center"> <tr> <td class="tcat"> Upload Files ... (0 Replies)
Discussion started by: jaango123
0 Replies
CURLINFO_HTTP_VERSION(3)				     curl_easy_getinfo options					  CURLINFO_HTTP_VERSION(3)

NAME
CURLINFO_HTTP_VERSION - get the http version used in the connection SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTP_VERSION, long *p); DESCRIPTION
Pass a pointer to a long to receive the version used in the last http connection. The returned value will be CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_1, or CURL_HTTP_VERSION_2_0, or 0 if the version can't be determined. PROTOCOLS
HTTP EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); res = curl_easy_perform(curl); if(res == CURLE_OK) { long http_version; curl_easy_getinfo(curl, CURLINFO_HTTP_VERSION, &http_version); } curl_easy_cleanup(curl); } AVAILABILITY
Added in 7.50.0 RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLINFO_RESPONSE_CODE(3), curl_easy_getinfo(3), curl_easy_setopt(3), libcurl 7.54.0 May 11, 2016 CURLINFO_HTTP_VERSION(3)
All times are GMT -4. The time now is 11:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy