• I can’t link the site because it’s entirely behind a password wall, but when I try to upload files, the files are renamed with no file type to something like f–1, f–2.. etc. You can rename it after uploading, but when you download the file it downloads as f–1 and there is no extension, so there is not way for the OS to know what kind of file it is. Every file type does this: docx, pdf, xlsx.. it doesn’t matter. I couldn’t find anything online about this but I found some Chinese site that has a public buddydrive and it had a file named f–1, so I know I’m not the only person experiencing this? What is going on here? Is it a conflict with another plugin, php version on the server side? Any ideas?

Viewing 10 replies - 1 through 10 (of 10 total)
  • daworm23

    (@daworm23)

    Hello,
    I have got the same problem. I looked in this forum (maybe badly) but I didn’t see an answer. I use the last version of WordPress with Twenty Seventeen them, I use BuddyPress and Buddydrive (great plugins) without other plugin. My WordPress is on a multisite.
    I tested in localhost with wamp, no problem. But online, all the files downloaded in Buddydrive become f–x (x is a number), like LebWeb.
    I need a little help please.
    Thank you.

    Hello,
    I have exactly the same problem. My buddypress, buddydrive, multi network and wordpress plugins are up to date. Buddydrive displays F – 1 instead of the file name and does not recognize the extension. @lebweb and @daworm23, did you find a solution? I feel that this forum is not very followed. is not it? Like @dopeboy, we would like the file type to be displayed as well. Thank you for following up.

    Hi,
    I found the solution to the file name problem renamed f–x. My wordpress site is hosted on an OVH server. The “.ovhconfig” file was placed in the “www” directory. I moved it to the root and everything works without understanding why …! Look perhaps also on the side of the file “.htaccess” if there is no problem.

    Hi
    I have exactly the same problem and my hosting is OVH.
    My .ovhconfig is in the right place.
    Do you find an other solution to this problem?

    I have the same problem and no solution

    I have testing to install buddydrive in local with “instantwordpress” and there is the same problem.
    I try to install an old version of wordpress (4.7.0) like in the description, not working too.
    Is it weird that buddydrive dont work in local ?

    for a comparaison bp docs and bp group document are working so it is not an upload problem.

    I continue my research..

    I try to move the .ovhconfig everywhere and it’s not working.
    @ericfaure can you tell me what is the config in your .ovhconfig ?

    Thanx to you in advance !

    Hello blub69,
    Here is my config .ovhconfig :

    app.engine=php
    app.engine.version=7.0
    http.firewall=security
    environment=production
    container.image=stable

    My .ovhconfig file is at the root of the site – my wordpress folder is in the www folder.

    Can you check on the ftp if your files are correctly named? chmod 755 on buddydrive folder. If so, maybe check the .htaccess too.

    I do not know how to help you, I am a beginner.

    Good luck !
    Eric

    hi Ericfaure and thanx for your answer.
    I try to configure with your config and it’s not working.
    There is an amelioration when I put my site in the www folder and I leave the basic permalinks of wordpress ( i can see the thumbnails ) but the name are still the same : f–*
    When I change the permalinks nothing work. ( no thumnails and files named f–1, f–2)

    In the buddydrive folder the files are named -1 -2 …

    I think there is an incompatibilities with the new version of buddypress and wordpress.

    @mrpritchett an upgrade will come ?

    Thanx for your answer

    Hello Blub69,
    Try to put this code in your bp-custom.php or in your function.php
    This function normally names the file with its extension. Useful for differentiating files. Only valid for new files, it does not rename old ones.
    See you soon

    if( function_exists ( 'buddydrive' ) ) {
    remove_action( 'wp_ajax_buddydrive_upload', 'buddydrive_upload_file' );
    
    function cust_buddydrive_upload_file() {
    	$is_html4 = false;
    	if ( ! empty( $_POST['html4' ] ) ) {
    		$is_html4 = true;
    	}
    
    	if ( empty( $_POST['bp_params'] ) && buddydrive_use_deprecated_ui() ) {
    		buddydrive_save_new_buddyfile();
    		return;
    	}
    
    	check_admin_referer( 'bp-uploader' );
    	$bp_params = (array) $_POST['bp_params' ];
    
    	if ( empty( $bp_params['item_id'] ) ) {
    		bp_attachments_json_response( false, $is_html4 );
    	}
    
    	if ( ! is_user_logged_in() || ( (int) bp_loggedin_user_id() !== (int) $bp_params['item_id'] && ! bp_current_user_can( 'bp_moderate' ) ) ) {
    		bp_attachments_json_response( false, $is_html4 );
    	}
    
    	$bd_file = buddydrive_upload_item( $_FILES, $bp_params['item_id'] );
    
    	if ( ! empty( $bd_file['error'] ) ) {
    		bp_attachments_json_response( false, $is_html4, array(
    			'type'    => 'upload_error',
    			'message' => $bd_file['error'],
    		) );
    	}
    
    	$name_parts = pathinfo( $bd_file['file'] );
    	$url        = $bd_file['url'];
    	$mime       = $bd_file['type'];
    	$file       = $bd_file['file'];
    	$title      = $name_parts['basename'];
    	$privacy    = buddydrive_get_default_privacy();
    	$groups     = array();
    
    	$parent_folder_id = 0;
    	if ( ! empty( $bp_params['parent_folder_id'] ) ) {
    		$parent_folder_id = (int) $bp_params['parent_folder_id'];
    	}
    
    	if ( ! empty( $bp_params['privacy'] ) ) {
    		$privacy = $bp_params['privacy'];
    
    		if ( ! empty( $bp_params['privacy_item_id'] ) && 'groups' === $privacy ) {
    			$groups = (array) $bp_params['privacy_item_id'];
    		}
    	}
    
    	$buddyfile_id = buddydrive_add_item( array(
    		'user_id'          => $bp_params['item_id'],
    		'type'             => buddydrive_get_file_post_type(),
    		'guid'             => $url,
    		'title'            => $title,
    		'mime_type'        => $mime,
    		'privacy'          => $privacy,
    		'groups'           => $groups,
    		'parent_folder_id' => $parent_folder_id,
    	) );
    
    	if ( empty( $buddyfile_id ) ) {
    		bp_attachments_json_response( false, $is_html4, array(
    			'type'    => 'upload_error',
    			'message' => __( 'Error while creating the file, sorry.', 'buddydrive' ),
    		) );
    	} else {
    		if ( 'public' === $privacy ) {
    			buddydrive_set_thumbnail( $buddyfile_id, $bd_file );
    		}
    	}
    
    	$response = buddydrive_prepare_for_js( $buddyfile_id );
    	$response['buddydrive_id'] = $response['id'];
    	$response['url']           = $response['link'];
    	$response['uploaded']      = true;
    	unset( $response['id'] );
    	bp_attachments_json_response( true, $is_html4, $response );
    }
    add_action( 'wp_ajax_buddydrive_upload', 'cust_buddydrive_upload_file' );
    }
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Filename and file type not recognized after upload, renamed f–*’ is closed to new replies.