What isn't correct with Windows 7?

23 views
Skip to first unread message

Ilya Skorik (RU)

unread,
Jun 5, 2011, 12:29:44 PM6/5/11
to Mojolicious
Sun Jun 5 8:23:56 PM 2011 error Mojolicious:: Controller:326 [9036]:
Can't move file "C:\temp\mojo.tmp.46ec30d6b11715e832b9c0869f87039a" to
"C:\Web\Store\datastore\requests\2011-05\2f8d9178-ee8a-4ad2-
a067-9df1286fa3a7\Tulips.jpg": No such file or directory at C:/
strawberry/perl/site/lib/Mojo/Upload.pm line 16

But C:\temp\mojo.tmp.46ec30d6b11715e832b9c0869f87039a exists!

Also I can't send files with assets and render_static, firefox say
404 - it is not found! But file exists, -e -r -w is true for it!

Sebastian Riedel

unread,
Jun 5, 2011, 12:35:56 PM6/5/11
to mojol...@googlegroups.com
I think this has been fixed a few releases ago, you should upgrade.

--
Sebastian Riedel
http://mojolicio.us
http://twitter.com/kraih
http://blog.kraih.com

> --
> You received this message because you are subscribed to the Google Groups "Mojolicious" group.
> To post to this group, send email to mojol...@googlegroups.com (mailto:mojol...@googlegroups.com).
> To unsubscribe from this group, send email to mojolicious...@googlegroups.com (mailto:mojolicious...@googlegroups.com).
> For more options, visit this group at http://groups.google.com/group/mojolicious?hl=en.


Ilya Skorik (RU)

unread,
Jun 6, 2011, 9:13:05 AM6/6/11
to Mojolicious
C:\Workspace>mojo version
CORE
Perl (5.010001, MSWin32)
Mojolicious (1.41, Smiling Face With Sunglasses)

OPTIONAL
IO::Epoll (not installed)
IO::KQueue (not installed)
IO::Socket::IP (not installed)
IO::Socket::SSL (not installed)
Net::Rendezvous::Publish (not installed)

This version is up to date, have fun!

On 5 июн, 20:35, Sebastian Riedel <kra...@googlemail.com> wrote:
> I think this has been fixed a few releases ago, you should upgrade.
>
> --
> Sebastian Riedelhttp://mojolicio.ushttp://twitter.com/kraihhttp://blog.kraih.com

Ilya Skorik (RU)

unread,
Jun 6, 2011, 9:21:00 AM6/6/11
to Mojolicious
Code:

# die 1 if (-r $temppath); # TRUE

my $headers = Mojo::Headers->new;
$headers->add("Content-Type", "application/excel;name=$filename");
$headers->add("Content-Disposition", "attachment;filename=$filename");
$headers->add("Content-Description", "xls");
$c->res->content->headers($headers);
$c->res->content->asset(Mojo::Asset::File->new(path => $temppath ));

$c->on_finish(sub {
unlink $temppath;
});

$c->render_static();

On 5 июн, 20:35, Sebastian Riedel <kra...@googlemail.com> wrote:
> I think this has been fixed a few releases ago, you should upgrade.
>
> --
> Sebastian Riedelhttp://mojolicio.ushttp://twitter.com/kraihhttp://blog.kraih.com

Sebastian Riedel

unread,
Jun 6, 2011, 9:21:09 AM6/6/11
to mojol...@googlegroups.com
Ok, assuming all tests passed it seems to be something in your application then.


Am Montag, 6. Juni 2011 um 15:13 schrieb Ilya Skorik (RU):

> C:\Workspace>mojo version
> CORE
> Perl (5.010001, MSWin32)
> Mojolicious (1.41, Smiling Face With Sunglasses)
>
> OPTIONAL
> IO::Epoll (not installed)
> IO::KQueue (not installed)
> IO::Socket::IP (not installed)
> IO::Socket::SSL (not installed)
> Net::Rendezvous::Publish (not installed)
>
> This version is up to date, have fun!
>

Sebastian Riedel

unread,
Jun 6, 2011, 9:25:57 AM6/6/11
to mojol...@googlegroups.com
That render_static call is wrong in multiple ways, it should not be there.
Building a new Mojo::Headers instance manually also seems a bit pointless, shouldn't cause problems though.


Am Montag, 6. Juni 2011 um 15:21 schrieb Ilya Skorik (RU):

> Code:
>
> # die 1 if (-r $temppath); # TRUE
>
> my $headers = Mojo::Headers->new;
> $headers->add("Content-Type", "application/excel;name=$filename");
> $headers->add("Content-Disposition", "attachment;filename=$filename");
> $headers->add("Content-Description", "xls");
> $c->res->content->headers($headers);
> $c->res->content->asset(Mojo::Asset::File->new(path => $temppath ));
>
> $c->on_finish(sub {
> unlink $temppath;
> });
>
> $c->render_static();
>

Ilya Skorik (RU)

unread,
Jun 6, 2011, 10:09:37 AM6/6/11
to Mojolicious
Code:
-----------------------------------------------------------------
#die -e $temppath; # TRUE
$c->tx->res->headers->header("content-type" => "binary/octet-
stream;name=text.xls");
$c->tx->res->headers->header("content-disposition" =>
"attachment;filename=test.xls");
$c->res->content->asset(Mojo::Asset::File->new(path => $temppath ));

Request:
-----------------------------------------------------------------
GET /reports/advertising/fascicle/cf235e7f-2c61-42b4-8e3f-cbcd50a25b2b
HTTP/1.1
Host: test:9292
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/
20100101 Firefox/4.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://test:9292/workspace/
Cookie: sid=AAD83731-6BF7-1014-B73D-3747C5E336C4;
session=eyJzaWQiOiJBQUQ4MzczMS02QkY3LTEwMTQtQjczRC0zNzQ3QzVFMzM2QzQiLCJtZW1iZXIiOiIzOWQ0MDgxMi1mYzU0LTQzNDItOWI5OC1lMWMxZjQyMjJkMjIiLCJleHBpcmVzIjoxMzA4MjMzMDMwfQ----0d75dd1d1c989188b44d9f834b242c7f
-----------------------------------------------------------------

The answer:
-----------------------------------------------------------------
HTTP/1.1 404 OK
Date: Mon, 06 Jun 2011 14:03:57 GMT
Server: Apache/2.2.18 (Win32)
Content-Disposition: attachment;filename=test.xls
X-Powered-By: Mojolicious (Perl)
Set-Cookie: sid=AAD83731-6BF7-1014-B73D-3747C5E336C4; Version=1
Content-Length: 5632
Keep-Alive: timeout=5, max=96
Connection: Keep-Alive
Content-Type: binary/octet-stream;name=text.xls
-----------------------------------------------------------------

Why 404 there?

On 6 июн, 17:25, Sebastian Riedel <kra...@googlemail.com> wrote:
> That render_static call is wrong in multiple ways, it should not be there.
> Building a new Mojo::Headers instance manually also seems a bit pointless, shouldn't cause problems though.
>
> --

Ilya Skorik (RU)

unread,
Jun 6, 2011, 10:16:03 AM6/6/11
to Mojolicious
It happens by operation through Windows 7 + Apache 2.2. In Mojo Server
errors aren't present, I see dialogue of saving of a file

On 6 июн, 17:25, Sebastian Riedel <kra...@googlemail.com> wrote:
> That render_static call is wrong in multiple ways, it should not be there.
> Building a new Mojo::Headers instance manually also seems a bit pointless, shouldn't cause problems though.
>
> --

Sebastian Riedel

unread,
Jun 6, 2011, 10:27:19 AM6/6/11
to mojol...@googlegroups.com
Do you actually call "$self->rendered" at some point?
It's a requirement, the built in server might just be a little more forgiving than Apache.

http://blog.kraih.com


Am Montag, 6. Juni 2011 um 16:16 schrieb Ilya Skorik (RU):

> It happens by operation through Windows 7 + Apache 2.2. In Mojo Server
> errors aren't present, I see dialogue of saving of a file
>

Ilya Skorik (RU)

unread,
Jun 6, 2011, 10:40:35 AM6/6/11
to Mojolicious
$c->tx->res->headers->header("content-type" => "binary/octet-
stream;name=text.xls");
$c->tx->res->headers->header("content-disposition" =>
"attachment;filename=test.xls");
$c->res->content->asset(Mojo::Asset::File->new(path => $temppath ));
$c->rendered();

= 404

On 6 июн, 18:27, Sebastian Riedel <kra...@googlemail.com> wrote:
> Do you actually call "$self->rendered" at some point?
> It's a requirement, the built in server might just be a little more forgiving than Apache.
>
> --

Sebastian Riedel

unread,
Jun 6, 2011, 10:41:51 AM6/6/11
to mojol...@googlegroups.com
Ok, but where do you set the status to 200?

http://blog.kraih.com


Am Montag, 6. Juni 2011 um 16:40 schrieb Ilya Skorik (RU):

> $c->tx->res->headers->header("content-type" => "binary/octet-
> stream;name=text.xls");
> $c->tx->res->headers->header("content-disposition" =>
> "attachment;filename=test.xls");
> $c->res->content->asset(Mojo::Asset::File->new(path => $temppath ));
> $c->rendered();
>
> = 404
>

Sebastian Riedel

unread,
Jun 6, 2011, 10:45:36 AM6/6/11
to mojol...@googlegroups.com
Just remembered that we recently set the default response code for CGI/FastCGI to 404 because of a DotCloud/uWSGI bug, that behavior could be inconsistent with the built in daemon.

Ilya Skorik (RU)

unread,
Jun 6, 2011, 10:49:43 AM6/6/11
to Mojolicious
Earlier this code worked! Now it is necessary to specify manually the
code 200? How it to make?

On 6 июн, 18:45, Sebastian Riedel <kra...@googlemail.com> wrote:
> Just remembered that we recently set the default response code for CGI/FastCGI to 404 because of a DotCloud/uWSGI bug, that behavior could be inconsistent with the built in daemon.
>
> --

Ilya Skorik (RU)

unread,
Jun 6, 2011, 11:00:51 AM6/6/11
to Mojolicious
This work fine:

$c->res->code(200);

$c->tx->res->headers->header("content-type" => "binary/octet-
stream;name=$filename");
$c->tx->res->headers->header("content-disposition" =>
"attachment;filename=$filename");
$c->tx->res->headers->header("content-description" => "xls");

$c->res->content->asset(Mojo::Asset::File->new(path => $temppath ));

$c->rendered();


Sebastian Riedel

unread,
Jun 6, 2011, 11:00:22 AM6/6/11
to mojol...@googlegroups.com
It should be fixed now. https://github.com/kraih/mojo/commit/78ca3b8d05788aec13085eee61a1f8dd9fbc2b94


Am Montag, 6. Juni 2011 um 16:49 schrieb Ilya Skorik (RU):

> Earlier this code worked! Now it is necessary to specify manually the
> code 200? How it to make?
>

Reply all
Reply to author
Forward
0 new messages