def resource_create_file_delete_view(request, id, file_id):
    # check ownership
    resource = get_object_or_404(Resource, pk=id)
    if not resource_can_edit(resource, request.user):
        raise Http404()

    try:
        ResourceFile.objects.get(resource=resource, pk=file_id).delete()
    except ResourceFile.DoesNotExist:
        pass

    return HttpResponseRedirect(reverse('orb_resource_create2', args=[id]))