Jump to content

naik.apoorv

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Posts posted by naik.apoorv

  1. So you're wanting the user to be able to download the file theirsite.com/file.zip, but you want the link to say yoursite.com/file.zip, but you also don't want the file to have to be on your site?

     

    Yeah. The scenario is like this

     

    Remote File: http://www.xyz.com/setup.exe

     

    On my site I wish to use a file say " download.php "

     

    that provides the same contents of the file by accessing it but not downloading it to my server.

  2. Dear PHPFreak members,

    I have been searching a solution for serving a file download via my website. The file to be downloaded is actually on a remote server.

     

    What i need is a code that serves as a download medium without actually downloading the file to my web server. Something like masking file url  :confused:

     

    Can anyone help me with it ???

    Have been trying this since days. But no solution till date.

  3. It's not possible. You can't redirect to a page on another domain and have the original domain still displayed in the address bar. Imagine the security implications this would have.

     

    Ok, I get it no problems with that . But how can I redirect my url to another url with the same parameters. Can u help me on that ?

    The remote url returns a file for download , I need that my url redirects to the remote one and provides the same download.

     

    Thnks for replying

  4. Hey I m a newbie in configuring the .htaccess files.

    Actually i need to redirect certain url patterns of my website to another website

     

    Ex:

     

    myurl : http://dl1.abc.com/<some query string>

    newurl: http://dl1.xyz.com/<same string as above>

     

    Can anyone help me out here ? I m so messed up with it .

    Also I need to know that can this redirection process be transparent to the end user , like, when he enter a link

     

    http://dl1.abc.com/<something> the redirection occurs but the url visible to the user is

    still

    http://dl1.abc.com

     

    currently i'm using the following code

     

    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^http://dl1.abc.com$

    RewriteRule ^(.*)$ http://dl1.xyz.com/$1 [R=301,L]

     

    Is the code correct or it needs some modifications ?

    Please provide a sample code .

     

  5. Will it be the same file downloaded multiple times, or multiple files downloaded once? If the latter you're probably going to struggle with this as you can't 'stream' files through a browser like that. Your server would have to download the >500MB file prior to allowing the user to download it. Dependent on your server's connection speed and how many users will be downloading at once, it could be a long wait.

     

    If it's the same file however, or several that are frequently used, I'd download a cached version periodically to your own server.

     

    Only a single file is to be downloaded at a time. Figuring out the problem of buffering, I had an idea of linking the download page to the file on remote server. " When the user accesses the download page it directly uses the remote file link in the header attachment ".

    Whether it would work ? I have not tried though but maybe I will be up with the code today for testing.

  6. Hey guys I m developing a download system for my server that reads files from a third party server and enables MY USER to download it via my URL. What mechanisms should i use to manage this efficiently ???

     

    file_get_contents();
    fopen();
    

     

    Or should I use some kind of buffer mechanism ??? Please do provide a code sample as I'm stuck here very badly.

     

    Note: The file sizes may be >500MB

  7. Hey guys i'm using the following code to POST data to the HTTPS url given below. But I m unable to perform a remote login and access the rest of the website. Can u find out the flaws in the code snippet and rectify it ? Or suggest a new code snippet.

     

    Also can anyone suggest how to open/read the contents of the login restricted pages on a successful login .

     

     

     

    $fullurl = "https://premium.rpnet.biz/login.php/";

    $postFields="username=&password=&cookieval=on&login=";

    $username="";

    $password="";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_HEADER, 1);

    curl_setopt($ch, CURLOPT_VERBOSE, 1);

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

    curl_setopt($ch, CURLOPT_FAILONERROR, 0);

    curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");

    curl_setopt($ch, CURLOPT_POSTFIELDS,$postFields);

    curl_setopt($ch, CURLOPT_URL, $fullurl);

    curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); # The name of the file containing the cookie data.

    curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");

    $returned = curl_exec($ch);

    curl_close ($ch);

    var_dump($returned);

     

    ---------------------------------------------------------------

    Output:

     

    HTTP/1.1 200 OK Date: Fri, 05 Nov 2010 16:27:58 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.3.3 Set-Cookie: PHPSESSID=nthfd25gn6vpm89k18fpgamgc6; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 6336 Connection: close Content-Type: text/html; charset=UTF-8

     

    ================================================

    If I change the url to https://premium.rpnet.biz/usercp.php/

    then the output is

     

    HTTP/1.1 302 Found Date: Fri, 05 Nov 2010 16:28:00 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.3.3 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: lo[uname]=deleted; expires=Thu, 05-Nov-2009 16:27:59 GMT; path=/; domain=premium.rpnet.biz Set-Cookie: lo[pass]=deleted; expires=Thu, 05-Nov-2009 16:27:59 GMT; path=/; domain=premium.rpnet.biz Location: https://premium.rpnet.biz/login.php Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8 bool(true)

  8. I have to get the data from the url

     

    https://test.httpapi.com/api/domains/available.json?auth-userid=0&auth-password=password&domain-name=domain&tlds=com&tlds=info&tlds=org&tlds=net&suggest-alternative=true

     

    The above url returns a JSON response when proper parameters are used .

    Can anyone suggest a portion of code that can handle this problem ??

     

    also the above url can return an xml response if the url used is

     

    https://test.httpapi.com/api/domains/available.xml?auth-userid=0&auth-password=password&domain-name=domain&tlds=com&tlds=info&tlds=org&tlds=net&suggest-alternative=true

     

    also can any1 provide a way of handling this .

    I m quite new to php and in need of help

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.