18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Problem facing with _lastDownloadedFileName()..gives only scripts name

shreyshrey Members
edited July 2011 in Sahi - Open Source
OS: fedora 14 (Laughlin) kernel 2.6.35.13-92.fc14.i686
Browser : Google-Chrome 12.0.742.124
Sahi build : 2011-07-19


Hi,

I have problem dealing with downloaded file..I have read issues on forum regarding this but after trying all those solution still I am facing problem....

I have scenario like this,

On my webpage I have directory structure showing in tree format and I have download button aside for download of that directory's content..what it does , when I click on the download button It goes to the download.php link with the directory name parameter like this "download.php?d=./Documents" and make "directory name".tar.gz file that contains all the file which are in that directory...after that it can be downloaded

I want to test that whatever file I download from that directory structure, it should download the same .tar.gz file which
had the same directory name aside...

but when I am using _LastDownloadedFileName() method it give me the name only download.php not "directory name".tar.gz.

I also checked the content-type by enabling logging...it is application/force-download. I have added this in download-content type but still getting the same result, _LastDownloadedFileName() gives only download.php not downloaded file name

How to deal with these issue?..


Regards,
shrey

Comments

  • narayannarayan Administrators
    Hi Shrey,

    Can you check what the content-disposition header value is?
    It is possible that Sahi is not detecting the name specified in content-disposition header, and using only the filename from the URL.

    We will have a look at this and get back to you.

    Regards,
    Narayan
  • shreyshrey Members
    Thanks for quick reply Narayana....

    yeah I have checked it in /sahi/userdata/logs/traffic/2011_07_26/12_55_02_799_.download.php folder....

    I am giving the content of the response.header_unmodified.txt file here which also helps you in finding out the problem...


    response.header_unmodified.txt
    Date: Tue, 26 Jul 2011 07:25:02 GMT
    Server: Apache/2.2.14 (Ubuntu)
    X-Powered-By: PHP/5.3.2-1ubuntu4.9
    Expires: 0
    Cache-Control: public
    Pragma: public
    Content-Description: File Transfer
    Content-Disposition: attachment; filename="Documents.tar.gz"
    Content-Transfer-Encoding: binary
    Keep-Alive: timeout=15, max=99
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: application/force-download
    Content-Length: 129
    Regards,
    shrey
  • narayannarayan Administrators
    Hi Shrey,

    We checked and see that Sahi does not use the file name in Content-Disposition header. We need to fix this from our side. It make take a couple of days to get you a patch.

    Regards,
    Narayan
  • shreyshrey Members
    edited July 2011
    Ok...


    Thanks for quick response Narayana..
  • minmin Members
    Hi Guys,

    Has the problem been solved yet? I am waiting for the patch.

    Thanks.

    Min
  • Hi min,

    This issue has been and will be available in the next release.

    Regards
    Sumitra
Sign In or Register to comment.