Like the topic said,
how can i to transfer to files to server using $_GET,
since ussualy i uses transfer is $_File,
i am using Ajax so, i need to using $_GET
not $_POST and $_FILE also --"
| Philip wrote: |
Like the topic said,
how can i to transfer to files to server using $_GET,
since ussualy i uses transfer is $_File,
i am using Ajax so, i need to using $_GET
not $_POST and $_FILE also --" |
This is the request string for a base64 encoded file with 196 bytes (your post)
| Quote: |
| http://example.com/get.php?name=test.txt&contents=TGlrZSB0aGUgdG9waWMgc2FpZCwNCmhvdyBjYW4gaSB0byB0cmFuc2ZlciB0byBmaWxlcyB0byBzZXJ2ZXIgdXNpbmcgJF9HRVQsDQpzaW5jZSB1c3N1YWx5IGkgdXNlcyB0cmFuc2ZlciBpcyAkX0ZpbGUsDQoNCmkgYW0gdXNpbmcgQWpheCBzbywgaSBuZWVkIHRvIHVzaW5nICRfR0VUDQpub3QgJF9QT1NUIGFuZCAkX0ZJTEUgYWxzbyAtLSINCg== |
Are you sure you want to get files with $_GET? ???????
See the LimitRequestLine directive for Apache.
| hexkid wrote: |
| Philip wrote: | Like the topic said,
how can i to transfer to files to server using $_GET,
since ussualy i uses transfer is $_File,
i am using Ajax so, i need to using $_GET
not $_POST and $_FILE also --" |
This is the request string for a base64 encoded file with 196 bytes (your post)
| Quote: | | http://example.com/get.php?name=test.txt&contents=TGlrZSB0aGUgdG9waWMgc2FpZCwNCmhvdyBjYW4gaSB0byB0cmFuc2ZlciB0byBmaWxlcyB0byBzZXJ2ZXIgdXNpbmcgJF9HRVQsDQpzaW5jZSB1c3N1YWx5IGkgdXNlcyB0cmFuc2ZlciBpcyAkX0ZpbGUsDQoNCmkgYW0gdXNpbmcgQWpheCBzbywgaSBuZWVkIHRvIHVzaW5nICRfR0VUDQpub3QgJF9QT1NUIGFuZCAkX0ZJTEUgYWxzbyAtLSINCg== |
Are you sure you want to get files with $_GET? ???????
See the LimitRequestLine directive for Apache. |
yes, of course i am very2x need it since i am using ajax, there's no other way to up/download information expect using $_GET.
but i don't under stand what u mean ? can u tell me how to convert a file into base64 encode, and to uploadit ? however it see we cannot using php script, since it already on client side, may be javascript ???
thanks
| Philip wrote: |
| can u tell me how to convert a file into base64 encode, and to uploadit ? |
JavaScript cannot read files from the hard disk. So there is no way to select a file to upload. What you can do with JavaScript is encode the contents of a textarea (the user has to open the file, copy and paste its contents in the textarea) and use that for the request.
I'm pretty sure you can find JavaScript encoders on the net.
Maybe this topic should be moved to the "Html, CSS and Javascript" forum ????
wew i am already try to find ! --"
And there said no way to upload files using ajax T_T
btw, that's not a gud way to ask user to open files and pasting,
espesially if the files is > 7 Mega wew
Maybe AJAX isn't the best solution for what you're trying to do? AJAX is for up-to-the minute information, quick server-side calculations using a database, and stuff like that. Bits of information. I think 7 megabyte file uploads aren't instantly mission critical kinda stuff.
| PatTheGreat42 wrote: |
| Maybe AJAX isn't the best solution for what you're trying to do? AJAX is for up-to-the minute information, quick server-side calculations using a database, and stuff like that. Bits of information. I think 7 megabyte file uploads aren't instantly mission critical kinda stuff. |
not that some times i just thinked that if that ok if we upload using cool way, like using AJAX.
btw i learned that using ajax is inposible but there's a way like ajax but using iframe 
You CAN use POST method with AJAX... But it won't help you anyway as you can't read the file using javascript.
i know i know, and there is no way javascript can access clients files >_<
I'd recommend $_POST[] more instead of $_GET[] for if you're using forms. You can use either of them for forms, but I recommend $_POST[] more as it's more secure.
Example on how I use it with $_POST[] :
Page 1 :
| Code: |
<form action='page2.php' method='post'>
Enter a number : <input type='Text' name='number'><br>
<button type='Submit'>Enter --></button></form> |
Page 2 :
| Code: |
<?php
echo"You entered the number <b>$_POST[number]</b> in the previous page.";
?> |
You can do the same thing for $_GET[] with that page too if you'd like, but $_POST is more secure from what I learned.
With $_GET[], you can also use it like this.
Let's say that the URL is like this : .../test.php?number=11
| Code: |
<?php
echo"The number that you entered in the address bar is <b>$_GET[number]</b>."; // In this case, it would show up as 11
?> |
You cannot do that with $_POST[] though, as it's not through a form.
With $_GET[], you can commonly change the stuff that you enter from the address bar, with $_POST[], you cannot. That's why I use $_POST[] for forms instead of $_GET[]. I only use $_GET[] if I'm collecting information like that from the address bar.
BTW, I've heard of the $_REQUEST[] variable, but I never really explored into it on how it works.
- Mike.
you want something, like add attachement in gmail
yes its cool, but I also dont know how they do it
just view source than copy and paste 
I know it;s more safety using $_POST, but when someone using AJAX for her/his sites, the variable will not show up in the address bar, so i think it safety also
and i think there's many2x think that new on web programming, i need to upgrade my BRAIN for this thing.. hehe
thanks,
Phil
Hehe.. that's awesome. File trough GET. Come on ... don't be lame! 