How to get download url?

Viewing 2 posts - 1 through 2 (of 2 total)
#197333

Nathan Thomas
Participant

Hello,

I am doing some work to add old versions of package files to ACF fields but i can’t appear to get the download url for a package file, how can i do this?

example of what i currently have

$files = get_package_data( $post_id, 'files' );
			if ( $files ) {
				// Define the new row to add.
				$new_row = array(
					'title'      ► get_the_title(),
					'date_added' ► gmdate( 'M d Y h:i:s A' ),
					'files'      ► array(),
				);

				foreach ( $files as $key ► $file ) {
					if ( isset( get_package_data( $post_id, 'fileinfo' )[ $key ] ) ) {
						$new_row['files'][] = array(
							'file_name' ► $file,
							'file_type' ► get_package_data( $post_id, 'fileinfo' )[ $key ]['type'],
							'file_size' ► get_package_data( $post_id, 'fileinfo' )[ $key ]['size'],
							'file_url'  ► get_the_permalink( $post_id ) . '?wpdmdl=' . $post_id . '&ind=' . \WPDM_Crypt::Encrypt( $key ),
						);
					}
				}

				add_row( 'previous_versions', $new_row, $post_id );
			}
#197334

Sidratul Sohrat
Spectator

Hello,

I hope this message finds you well. I am writing to sincerely apologize for the disruption in our services over the past couple of days. Unfortunately, we have experienced an unexpected technical issue due to a fire incident that broke out in our data center. This incident has caused a collapse of the internet connection country-wide, and as a result, we are currently not fully operational.

We will reach out to you as soon as the problem is resolved and ensure that your concerns are addressed promptly.

Thank you for your patience and understanding during this challenging time.

Regards

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.