33 of 39
33
File
Posted: 02 July 2008 12:25 AM   [ Ignore ]   [ # 577 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1590
Joined  01-05-2007

haha I’m not familiar with the command line. How would one go about sudoing?

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 02 July 2008 12:37 AM   [ Ignore ]   [ # 578 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15343
Joined  05-15-2004

Just like that, “sudo” (as in “SUperuser DO”) on the commandline, directly followed by the command you want to run as root.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 02 July 2008 02:58 AM   [ Ignore ]   [ # 579 ]  
Grad Student
Avatar
Rank
Total Posts:  81
Joined  12-26-2006

indeed, it seems the original file is set at permission 600, while a thumbnail is created as 622.

stinhambo - not sure if you fixed your problem, but to use sudo simply type:

sudo chmod 644 <filename>

in the same directory as the file itself.  you should read-up on unix commands sudo and chmod when you get a chance.

With that out of the way - can anyone verify if they are having similar “strict” file permission issues on the originally uploaded file?

 Signature 

Majides, Inc.
Fuelling CodeIgniter and ExpressionEngine from Japan

Profile
 
 
Posted: 02 July 2008 07:30 AM   [ Ignore ]   [ # 580 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

I’m not—- I’m seeing 755 or 777 on both the original upload and the thumb. I think it heavily depends on how PHP and Apache are setup, including if you’re running PHPSuExec.

Profile
 
 
Posted: 03 July 2008 05:47 AM   [ Ignore ]   [ # 581 ]  
Grad Student
Rank
Total Posts:  89
Joined  03-20-2007

I’ve got the same problem with the permission of the original file. Thumbs were ok, original pictures were set to 6xx and not readable for a browser client.

I’ve solved the problem via a chmod “hack”. Look in ext_mh_file.php ( v3.1.1) for lines 864 - 87x:

//  =============================================
//  Do the Upload
//  =============================================
foreach($file_tmp_names as $file_key=>$file_tmp_name)
{
    
if(@move_uploaded_file($file_tmp_name, $server_path.$file_names[$file_key]) === FALSE)
    {
        $errors[]
= str_replace(array('%{field}', '%{file}'), array($file_field['field_label'], $file_names[$file_key]), $LANG->line('error_transfer'));
    
}
    
@chmod($server_path.$file_names[$file_key], 0777); // added by author of this post
}

The last line with the chmod function was added by me and the extension is working right now.

2nd

Profile
 
 
Posted: 03 July 2008 09:46 AM   [ Ignore ]   [ # 582 ]  
Summer Student
Avatar
Total Posts:  27
Joined  05-29-2007

slapshotw - sorry I missed your reply to my last post. Do you know if there’s somewhere I can get more information about using a PHP variable for {count}?

Profile
 
 
Posted: 03 July 2008 09:58 AM   [ Ignore ]   [ # 583 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

Are you familiar with PHP? Make sure PHP is set to output. Set the variable to 0 before you start the tag loop, then increment it ($var++;) at the very beginning of the loop (right after the opening tag). Then you can do if/thens in PHP, and use PHP to echo the correct output.

Profile
 
 
Posted: 03 July 2008 10:04 AM   [ Ignore ]   [ # 584 ]  
Summer Student
Avatar
Total Posts:  27
Joined  05-29-2007

I’m just getting up to speed on PHP, but this is outside of what I know. I’ve got a small budget set aside for things like this if you or someone you know would be willing to code this for me.

Profile
 
 
Posted: 09 July 2008 03:21 PM   [ Ignore ]   [ # 585 ]  
Summer Student
Avatar
Total Posts:  22
Joined  11-06-2006

Trouble with File 3.1.1 and SQL 4.x.x?

Hi all,  I’m not the best with PHP or SQL but here’s my problem, and the solution I created.

I was having trouble with the newest iteration of this extension when using mySQL 4.1.13.  After taking a look at the file I determined the cause of the issue.  The SQL statement that updates the prefs table in the database is a newer piece of code that combines both the insert and update statements into one, allowing mySQL to check for a pre-existing table in the database instead of PHP.  I don’t know of a way to combine these two queries into one, the way the Mark did, but its not like these queries will be called much anyway.  The code change is below:

Replace the code on line 491:

$DB->query("INSERT INTO exp_mh_file VALUES('', {$id}, '{$key}', '{$value}') ON DUPLICATE KEY UPDATE id=values(id), `key`=values(`key`), value=values(value)");

—With the following—

$pref_results = $DB->query("SELECT * FROM exp_mh_file WHERE exp_mh_file.upload_id='{$id}' AND exp_mh_file.key='{$key}'");
if (!
$pref_results) {
$DB
->query("INSERT INTO exp_mh_file VALUES('', {$id}, '{$key}', '{$value}')");
}else{
$DB
->query("UPDATE exp_mh_file SET exp_mh_file.value='{$value}' WHERE exp_mh_file.upload_id='{$id}' AND exp_mh_file.key='{$key}'");
}

 Signature 

Dan Made This

Profile
 
 
Posted: 10 July 2008 10:38 AM   [ Ignore ]   [ # 586 ]  
Summer Student
Total Posts:  7
Joined  10-11-2007

No matter what I try thumbnails are not created when I upload an image.  When I use the regular ‘Upload File’ control on the regular weblog post form, I can use the popup to resize and create a thumbnail.  But when using Mark’s extension my main image is uploaded ok, but the thumbnail never appears.

Any suggestions anyone.  Does the select image toolkit matter?

Profile
 
 
Posted: 10 July 2008 11:11 AM   [ Ignore ]   [ # 587 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

Are you sure your settings are set to Keep Originals = Yes, you set max image height and width, and you put a setting for Resize Images?

Profile
 
 
Posted: 10 July 2008 08:36 PM   [ Ignore ]   [ # 588 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1590
Joined  01-05-2007

I noticed the Owner and Group name for File uploads are different to my normal files.

Will cause any issues when it comes to migrating to a live server?

Image Attachments
screen-capture.pngscreen-capture-1.png
Click thumbnail to see full-size image
 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 10 July 2008 10:05 PM   [ Ignore ]   [ # 589 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

It depends on how your server is setup and how you’ll be doing the migration. You can always chown the files to the new server though.

Edit: Everyone can read the files anyway, so you won’t have a problem with people viewing the images.

Profile
 
 
Posted: 10 July 2008 10:15 PM   [ Ignore ]   [ # 590 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1590
Joined  01-05-2007

Hey Slapshotw, are you Mark Huot in disguise?

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 10 July 2008 10:19 PM   [ Ignore ]   [ # 591 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

No…just use this extension a lot, have looked through its code a lot, and try to help on the thread whenever possible in his absence.

Profile
 
 
Posted: 10 July 2008 10:21 PM   [ Ignore ]   [ # 592 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1590
Joined  01-05-2007

Well it’s much appreciated mate smile

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 11 July 2008 02:41 AM   [ Ignore ]   [ # 593 ]  
Summer Student
Total Posts:  7
Joined  10-11-2007
slapshotw - 10 July 2008 11:11 AM

Are you sure your settings are set to Keep Originals = Yes, you set max image height and width, and you put a setting for Resize Images?

My missing width and height were the problem.  Many thanks.

Profile
 
 
Posted: 18 July 2008 09:08 AM   [ Ignore ]   [ # 594 ]  
Summer Student
Avatar
Total Posts:  26
Joined  03-19-2008

Hope this hasn’t been covered before but I’m having a problem using the variable pair with other custom fields.

File field is ‘resources_file’.

{exp:weblog:entries weblog="resources"}
                
<div class="resource">
                <
h2>{title}</h2>
                
{resources_description}
                
<p class="filename">{resources_file}{file_name}{/resources_file}</p>
                <
p class="permalink">[<a href="{title_permalink=template_name/resources}">Download File</a>] ({resources_filesize} - {resources_filetype})
                </
div>
            
{/exp:weblog:entries}


If I just use

{resources_file}

everything works fine, but when I try to just get the file_name rather than the full path using

{resources_file}{file_name}{/resources_file}

, the other custom fields (‘resources_filesize’ and ‘resources_filetype’) don’t work.

Profile
 
 
   
33 of 39
33
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64877 Total Logged-in Users: 77
Total Topics: 81802 Total Anonymous Users: 37
Total Replies: 439742 Total Guests: 297
Total Posts: 521544    
Members ( View Memberlist )
Newest Members:  dxrsmdanbilly8hrkiliwysso50kexpressoKlaasdarrenstylestravelerjcatoncvadrata