mintUpload customisation

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

mintUpload customisation

Postby pan0ram1c on Sun Sep 07, 2008 4:16 am

I'm trying to customise mintUpload so I can upload files to my ftp server instead of using the Default mintUpload service. I successfully managed to do that by following this guide. However, when a file is uploaded it is placed in the VPS main dir, thus the file path : http://myservername/uploadedfile.rar is not correct , as the file is uploaded somewhere else. Is there any way to specify the default remote directory path within mintUpload so when I upload a file to be placed within my /www/servername directory?
pan0ram1c
Level 1
Level 1
 
Posts: 3
Joined: Tue Oct 02, 2007 12:29 pm

Linux Mint is funded by ads and donations.
 

Re: mintUpload customisation

Postby Lantesh on Sun Sep 07, 2008 3:43 pm

I'm sorry I don't know the answer to your question, but what about taking an alternative route like using gFTP?
Lantesh
Level 6
Level 6
 
Posts: 1219
Joined: Sat Apr 12, 2008 1:02 pm

Re: mintUpload customisation

Postby pan0ram1c on Mon Sep 08, 2008 12:13 pm

I'm already using fpt client (Filezilla)

My main idea was to be able to upload a file with a 2 clicks action, but instead of using the default mintUpload storage place I want to upload files to my own ftp storage.

However, as I my concern is, when I upload a file to my storage server through the tweaked mintUpload, the file ends being uploaded at the root of the server machine.

Therefore I am looking for if it's possible to specify default remote directory through mintUpload.
pan0ram1c
Level 1
Level 1
 
Posts: 3
Joined: Tue Oct 02, 2007 12:29 pm

Re: mintUpload customisation

Postby Fingel on Fri Sep 26, 2008 3:04 am

You need to add a "path" variable to the config file. Ex:
File:/usr/lib/linuxmint/mintUpload/services/<servicename>
Code: Select all
name=<YourName>
host=<YourDomain>   
user=<username>
pass=<password>
path=httpdocs/uploads/(or whatever you want)
space=http://<yourdomain>/uploads/space.html
url=http://<yourdomain>/uploads/<FILE>
maxsize=1000000000
persistance=365


Now for some reason, even after taking away the <TIMESTAMP> variable, it keeps putting the files in subdirectories named after the timestamp. I have no use for these directories since I dont plan on deleting any of the files, and it would be nice to be able to see all the files by name in the upload directory. Anyone know how to get rid of these annoying timestamps?
Brothers and Sisters, join us. www.LinuxCult.org
ImageImageImage
User avatar
Fingel
Level 1
Level 1
 
Posts: 15
Joined: Fri Sep 26, 2008 2:38 am

Re: mintUpload customisation

Postby Fingel on Fri Sep 26, 2008 12:31 pm

Ok I figured it out. Didnt realize this tool was written in python so you can pretty much do whatever you want.
In order to stop mintUpload from placing files in subdirectories named after the timestamp, you need to comment out lines 155, 156, 157 and 162.
Code: Select all
#timestamp = datetime.datetime.utcnow().strftime("%Y%m%d%H%M%S")
      #directory = ftp.mkd(timestamp)
      #ftp.cwd(directory)
      ftp.storbinary('STOR ' + name, f, 1024, callback=self.asciicallback)
      progressbar.set_fraction(1)
      f.close()
      ftp.quit()
      #url = url.replace("<TIMESTAMP>", timestamp)

Now mintupload will upload files directly to your upload folder, without subdirectories.
Brothers and Sisters, join us. www.LinuxCult.org
ImageImageImage
User avatar
Fingel
Level 1
Level 1
 
Posts: 15
Joined: Fri Sep 26, 2008 2:38 am


Return to Newbie Questions

Who is online

Users browsing this forum: BertVK and 32 guests