Search Results

Search found 4783 results on 192 pages for 'txt'.

Page 48/192 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • How to simulate browser form POST method using PHP/cURL

    - by user283266
    I'm trying to simulate browser with POST method using PHP/cURL. When I looked at that live Http header it shows Content-Type: multipart/form-data. I checked on the internet where it was suggested that cURL will send multipart/form-data when a custom headers is specified to Content-Type: multipart/form-data. $headers = array( 'Content-Type' => 'multipart/form-data; boundary='.$boundary ); This didn't work for me either when I print_r(curl_getinfo()) it showed [content_type] => text/html; charset=UTF-8 Which means cURL sent a default headers I also read that sending/uploading a file with cURL will cause data to be send as multipart/form-data. I created a file which curl uploaded but again when I ran curl_getinfo I got [content_type] => text/html; charset=UTF-8 $data_array = array("field" => "@c:\file_location.txt"); I also tried to read a file content so that the only thing sent would be content NOT ATTACHED FILE but this didn't work for me curl_getinfo shows [content_type] => text/html; charset=UTF-8. $data_array = array("field" => "<c:\file_location.txt"); // note @ replaced with < Do I miss somthing here? This is the referer url POST somepath HTTP/1.1 Host: www(dot)domain(dot)com User-Agent: Mozilla/5.0 (Windows) Gecko/13081217 Firefox/3 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: url/some-file.php Content-Type: multipart/form-data; boundary=--------------------------$boundary Content-Length: $some_number ----------------------------$boundary Content-Disposition: form-data; name="$some_Value1" $some_text1 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value2" $some_text2 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value3" $some_text3 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value4" $some_text4 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value5" $some_text5 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value6" $some_text6 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value7" $some_text7 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value8" $some_text8 ----------------------------$boundary Content-Disposition: form-data; name="$some_Value9" ----------------------------$boundary Content-Disposition: form-data; name="$some_Value10" ----------------------------$boundary-- Here is a piece of code. <? //Include files set_time_limit(0); include'body.php'; include'keyword.php'; include'bio.php'; include'summary.php'; include'headline.php'; include'category.php'; include'spin.php'; include'random-text.php'; $category = category(); $headline = headline() ; $summary = summary(); $keyword = keyword(); $body = body(); $bio = bio(); $target="url"; $ref ="url_ref"; $c = "Content-Disposition: form-data; name="; $boundary = "---------------------------".random_text(); $category = category(); $headline = headline() ; $summary = summary(); $keyword = keyword(); $body = body(); $bio = bio(); // emulating content form as it appears on livehttp header $data = "\r\n".$boundary."\r\n".$c."\"pen_id\"\r\n\r\n".$Auth_id."\r\n".$boundary."\r\n".$c."\"cat_id\"\r\n\r\n".category()."\r\n".$boundary."\r\n".$c."\"title\"\r\n\r\n".headline()."\r\n".$boundary."\r\n".$c."\"meta_desc\"\r\n\r\n".summary()."\r\n".$boundary."\r\n".$c."\"meta_keys\"\r\n\r\n".keyword()."\r\n".$boundary."\r\n".$c."\"content\"\r\n\r\n".body()."\r\n".$boundary."\r\n".$c."\"author_bio\"\r\n\r\n".bio()."\r\n".$boundary."\r\n".$c."\"allow_comments\"\r\n\r\ny\r\n".$boundary."\r\n".$c."\"id\"\r\n\r\n\r\n".$boundary."\r\n".$c."\"action\"\r\n\r\n\r\n".$boundary."--\r\n"; // inserting content into a file $file = "C:\file_path.txt"; $fh = fopen($file, 'w+') or die("Can't open file"); fwrite($fh,$data); fclose($fh); // pulling out content from a file as multipart/form-data $data_array = array ("field" => "<C:\file_path.txt"); $headers = array ( 'POST /myhome/article/new HTTP/1.1', 'Host: url', 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729)', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9;q=0.8', 'Accept-Language: en-us,en;q=0.5', 'Accept-Encoding: gzip,deflate', 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Keep-Alive: 300', 'Connection: keep-alive', 'Content-Type: multipart/form-data; boundary='.$boundary, 'Content-Length: '.strlen($data), ); # Create the cURL session $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target); // Define target site curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_HEADER, $headers); // No http head //curl_setopt($ch, CURLOPT_REFERER, $ref); curl_setopt($ch, CURLOPT_NOBODY, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Return page in string curl_setopt($ch, CURLOPT_COOKIEJAR, "c:\cookie\cookies.txt"); // Tell cURL where to write curl_setopt($ch, CURLOPT_COOKIEFILE, "c:\cookie\cookies.txt"); // Tell cURL which cookies //curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, "$data_array"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); // Follow redirects curl_setopt($ch, CURLOPT_MAXREDIRS, 4); # Execute the PHP/CURL session and echo the downloaded page $page = curl_exec($ch); $err = curl_error($ch); $info =curl_getinfo($ch); # Close the cURL session curl_close($ch); print_r($err); print_r($info); ?>

    Read the article

  • Excel Export Issue displaying '#####...'

    - by Cypher
    Hey, I'm trying to just export and excel database into .txt (Tab Delimited) but some of my cells are quite large. When I export into a txt some of the cells are exported as '#######....' which is surprisingly useless. Has this happened to anyone else?/ know an easy fix?

    Read the article

  • Running a python script on all the files in a directory.

    - by S1syphus
    I have a Python script that reads through a text csv file and creates a playlist file. However I can only do one at a time, like: python playlist.py foo.csv foolist.txt However, I have a directory of files that need to be made into a playlist, with different names, and sometimes a different number of files. So far I have looked at creating a txt file with a list of all the names of the file in the directory, then loop through each line of that, however I know there must be an easier way to do it.

    Read the article

  • django filebrowser extensions problem

    - by Borislav
    Hi, I've set django filebrowser's debug to True and wrote the extension restrictions in the model. pdf = FileBrowseField("PDF", max_length=200, directory="documents/", extensions=['.pdf', '.doc', '.txt'], format='Document', blank=True, null=True) In django admin it shows correctly with debug info. Directory documents/ Extensions ['.pdf', '.doc', '.txt'] Format Document But when I call the filebrowser, it allows all file extensions to be uploaded. How can I restrict filebrowser to upload only certain filetypes that I want? Thanks everyone

    Read the article

  • Batch commands execution order

    - by Dave18
    I'm looking to run a second batch command from .bat but after the first command has been done. REN "myfile.txt" "my_file.txt" start "title" "path" Here, I want the rename command to be executed before the process I wanted to start that has been terminated or executed. why it doesn't work in sequence order?

    Read the article

  • Grep and Awk in Windows Invalid Char in Expression Error

    - by Nathan
    I am new to grep and awk - using Windows 7 (I downloaded grep and awk for windows from GnuWin). I am have having trouble running this script: grep -Fwf dictionary.txt frequency.txt | awk '{print $2 "," $1}' I get the error: awk: '{print awk: ^ invalid char ''' in expression I believe it might have something to do with having to use double quotes in Windows, but I tried all the combinations I can think of and still it doesn't work. Can anyone help? Thanks

    Read the article

  • Problem with UTF8

    - by jriff
    Hi all! If you are on Mac OS X 10.6, and you are familiar with character encoding AND the terminal please do this: Open a terminal and type the following commands: echo sørensen test.txt iconv -f UTF8 -t ISO-8859-1 test.txt You will see the output: "sørensen". Can somebody explain what is going on?

    Read the article

  • ASP.NET reading files from BIN

    - by nettguy
    I am processing some CSV file which i have copied in Bin folder of My ASP.NET Website. When i execute using (IDataReader csv = new CsvReader (new StreamReader("sample.txt"), true, '|')) { ..... } it complains me that "sample.txt" not found in "c:\Program Files\.....\" Won't the runtime automatically look into the bin folder? what modification do i need to do?

    Read the article

  • How to retrieve data from textarea or text field and store in a text file with the same data format,

    - by Sunil Kumar Sahoo
    Hi I have created a text field in java and i am able to get the data from text field and store in a .txt file. But My problem is that let the my data in textfield is in bold and italic format and the font colour is red. Now I want to store the data exactly in the same format in .txt file. I donot know how to write code for that. Anyone please help me to solve this type of problem Thanks Sunil Kumar Sahoo

    Read the article

  • Problem with iconv

    - by jriff
    Hi all! If you are on Mac OS X 10.6, and you are familiar with character encoding AND the terminal please do this: Open a terminal and type the following commands: echo sørensen test.txt iconv -f UTF8 -t ISO-8859-1 test.txt You will see the output: "sørensen". Can somebody explain what is going on?

    Read the article

  • puts() a pointer in C

    - by Sergey Gavruk
    I have a function: char *make_text(void) { char txt[MAXLEN]; //make something return txt; } Thats my main program: int main(void) { char *s = make_text(); puts(s); getch(); return 0; } puts(s) returns 0 and its nothing printed. Whats happened?

    Read the article

  • how to change file permissions in postfix ?

    - by Zdanozdan
    Hi, In the postfix main.cf I have configured service to invoke external php script. smtp inet n - - - - smtpd -o content_filter=myservice:www-data myservice unix - n n - 1 pipe flags=Rq user=me null_sender= argv=/home/me/my_script.php so far so good, my_script.php is executed. It creates the file my_file.txt in home dir. However I can only manage -rw------- 1 me www-data 16 2009-10-11 19:35 my_file.txt How do I add 'r' permissions for www-data group ?

    Read the article

  • Why a different SHA-1 for the same file under windows or linux?

    - by Fabio Vitale
    Why on the same machine computing the SHA-1 hash of the same file produces two completely different SHA-1 hashes in windows and inside a msysgit Git bash? Doesn't the SHA-1 algorithm was intended to produce the same hash for the same file in all OSes? On windows (with HashCheck): File hello.txt 22596363b3de40b06f981fb85d82312e8c0ed511 Inside a msysgit's Git bash windows (same machine, same file): $ git hash-object hello.txt 3b18e512dba79e4c8300dd08aeb37f8e728b8dad

    Read the article

  • Python - create blacklist file of IP addresses that have more than 5 failed login attempts in the au

    - by oz_babe
    Basically I have an authlog/syslog file with a list of log in attempts and IP addresses - I need to make a Python program that will create a txt file with all the IP addresses that have more than 5 failed login attempts - a sort of "blacklist". So basically something like: if "uniqueipaddress" and "authentication failure" appear more than 5 times, add uniqueipaddress to txt file. Any help would be greatly appreciated - please try and make it simple as I am very, very inexperienced in programming in Python! Thanks.

    Read the article

  • IO Exception: directory name is invalid using directory from File System Watcher OnChanged Event

    - by Bi
    My C# application throws a System.IO.IOExcepton (The directory name is invalid) for the following code for implementing a filewatcher: public void OnChanged(object source, FileSystemEventArgs e) { DirectoryInfo dList = new DirectoryInfo(e.FullPath); FileInfo[] TxtFiles = dList.GetFiles("*.TXT"); } e.FullPath is "C:/Documents and Settings/Bi/Application Data/TestApp/Reports\\0MA01P62240_000005798_TRI_4947712701738551.TXT". If you notice it seems to append a "\\" to the path when it tracks the file. Any idea what the problem may be?

    Read the article

  • Create a CSR in C# using an explicit RSA key-pair

    - by rlandster
    Using the OpenSSL libraries one can create a CSR (certificate signing request) by doing this: openssl genrsa -out rsa.key 1024 openssl req -new -key rsa.key -out output.csr -config config.txt where config.txt contains the distinguished name to use in the certificate. I would like to do something similar under Windows using C#. However, the method createPKCS10 does not require you to supply an RSA key. Is there a way to get C# to generate an explicit RSA private key and then use that private key to create the CSR?

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >