Delete file after file_stream is complete (8.6)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Delete file after file_stream is complete (8.6)

Mason Miller
I need to delete a file after is is done being streamed. If I comment out the file_stream section this deletes the file just fine. When I stream first, it does not delete. I guessing that I need to make this stuff run synchronously, but I thought that is what it would do as written…

Thanks,

Mason

<?lassoscript
library:'/siteincludes/sitetest.html';
var('path') = encode_sql(action_param('path'));
if:$path >> '.zip' && $path >> ('/users/jw/'+$photographerID +'/');
        inline: -username=‘xxxxx', -password = ‘xxxxxx';
                File_Stream:
                        -File=$path
                , -Name='photoFavorites.zip'
                , -Type='application/zip'
        ;
        /inline;
        file_delete:$path;
        error_currenterror;
/if;
?>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Delete file after file_stream is complete (8.6)

Marc Pinnell-3
Is File_Stream like File_Serve in that processing on the page stops at that point?

====================
Marc Pinnell
Director of Web Services
[hidden email]
www.shasta.com                                    
833 Mistletoe Lane, Suite A1
Redding, CA  96002
530-224-6866  Ext. 100
530-224-2035 Fax

> On Mar 10, 2017, at 12:17 PM, Mason Miller <[hidden email]> wrote:
>
> I need to delete a file after is is done being streamed. If I comment out the file_stream section this deletes the file just fine. When I stream first, it does not delete. I guessing that I need to make this stuff run synchronously, but I thought that is what it would do as written…
>
> Thanks,
>
> Mason
>
> <?lassoscript
> library:'/siteincludes/sitetest.html';
> var('path') = encode_sql(action_param('path'));
> if:$path >> '.zip' && $path >> ('/users/jw/'+$photographerID +'/');
> inline: -username=‘xxxxx', -password = ‘xxxxxx';
> File_Stream:
> -File=$path
> , -Name='photoFavorites.zip'
> , -Type='application/zip'
> ;
> /inline;
> file_delete:$path;
> error_currenterror;
> /if;
> ?>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>